| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 void didAddInsertionPoint(InsertionPoint*); | 53 void didAddInsertionPoint(InsertionPoint*); |
| 54 void didRemoveInsertionPoint(InsertionPoint*); | 54 void didRemoveInsertionPoint(InsertionPoint*); |
| 55 | 55 |
| 56 bool containsShadowElements() const { return m_descendantShadowElementCount;
} | 56 bool containsShadowElements() const { return m_descendantShadowElementCount;
} |
| 57 bool containsContentElements() const { return m_descendantContentElementCoun
t; } | 57 bool containsContentElements() const { return m_descendantContentElementCoun
t; } |
| 58 bool containsShadowRoots() const { return m_childShadowRootCount; } | 58 bool containsShadowRoots() const { return m_childShadowRootCount; } |
| 59 | 59 |
| 60 unsigned descendantShadowElementCount() const { return m_descendantShadowEle
mentCount; } | 60 unsigned descendantShadowElementCount() const { return m_descendantShadowEle
mentCount; } |
| 61 | 61 |
| 62 void didAddChildShadowRoot() { ++m_childShadowRootCount; } | 62 void didAddChildShadowRoot() { ++m_childShadowRootCount; } |
| 63 void didRemoveChildShadowRoot() { ASSERT(m_childShadowRootCount > 0); --m_ch
ildShadowRootCount; } | 63 void didRemoveChildShadowRoot() { DCHECK_GT(m_childShadowRootCount, 0u); --m
_childShadowRootCount; } |
| 64 | 64 |
| 65 unsigned childShadowRootCount() const { return m_childShadowRootCount; } | 65 unsigned childShadowRootCount() const { return m_childShadowRootCount; } |
| 66 | 66 |
| 67 const HeapVector<Member<InsertionPoint>>& descendantInsertionPoints() { retu
rn m_descendantInsertionPoints; } | 67 const HeapVector<Member<InsertionPoint>>& descendantInsertionPoints() { retu
rn m_descendantInsertionPoints; } |
| 68 void setDescendantInsertionPoints(HeapVector<Member<InsertionPoint>>& list)
{ m_descendantInsertionPoints.swap(list); } | 68 void setDescendantInsertionPoints(HeapVector<Member<InsertionPoint>>& list)
{ m_descendantInsertionPoints.swap(list); } |
| 69 void clearDescendantInsertionPoints() { m_descendantInsertionPoints.clear();
} | 69 void clearDescendantInsertionPoints() { m_descendantInsertionPoints.clear();
} |
| 70 | 70 |
| 71 StyleSheetList* styleSheets() { return m_styleSheetList.get(); } | 71 StyleSheetList* styleSheets() { return m_styleSheetList.get(); } |
| 72 void setStyleSheets(RawPtr<StyleSheetList> styleSheetList) { m_styleSheetLis
t = styleSheetList; } | 72 void setStyleSheets(RawPtr<StyleSheetList> styleSheetList) { m_styleSheetLis
t = styleSheetList; } |
| 73 | 73 |
| 74 void didAddSlot() { ++m_descendantSlotCount; } | 74 void didAddSlot() { ++m_descendantSlotCount; } |
| 75 void didRemoveSlot() { ASSERT(m_descendantSlotCount >= 1); --m_descendantSlo
tCount; } | 75 void didRemoveSlot() { DCHECK_GT(m_descendantSlotCount, 0u); --m_descendantS
lotCount; } |
| 76 | 76 |
| 77 unsigned descendantSlotCount() const { return m_descendantSlotCount; } | 77 unsigned descendantSlotCount() const { return m_descendantSlotCount; } |
| 78 | 78 |
| 79 const HeapVector<Member<HTMLSlotElement>>& descendantSlots() const { return
m_descendantSlots; } | 79 const HeapVector<Member<HTMLSlotElement>>& descendantSlots() const { return
m_descendantSlots; } |
| 80 | 80 |
| 81 void setDescendantSlots(HeapVector<Member<HTMLSlotElement>>& slots) { m_desc
endantSlots.swap(slots); } | 81 void setDescendantSlots(HeapVector<Member<HTMLSlotElement>>& slots) { m_desc
endantSlots.swap(slots); } |
| 82 void clearDescendantSlots() { m_descendantSlots.clear(); } | 82 void clearDescendantSlots() { m_descendantSlots.clear(); } |
| 83 | 83 |
| 84 DEFINE_INLINE_TRACE() | 84 DEFINE_INLINE_TRACE() |
| 85 { | 85 { |
| 86 visitor->trace(m_shadowInsertionPointOfYoungerShadowRoot); | 86 visitor->trace(m_shadowInsertionPointOfYoungerShadowRoot); |
| 87 visitor->trace(m_descendantInsertionPoints); | 87 visitor->trace(m_descendantInsertionPoints); |
| 88 visitor->trace(m_styleSheetList); | 88 visitor->trace(m_styleSheetList); |
| 89 visitor->trace(m_descendantSlots); | 89 visitor->trace(m_descendantSlots); |
| 90 } | 90 } |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 Member<HTMLShadowElement> m_shadowInsertionPointOfYoungerShadowRoot; | 93 Member<HTMLShadowElement> m_shadowInsertionPointOfYoungerShadowRoot; |
| 94 unsigned m_descendantShadowElementCount; | 94 unsigned m_descendantShadowElementCount; |
| 95 unsigned m_descendantContentElementCount; | 95 unsigned m_descendantContentElementCount; |
| 96 unsigned m_childShadowRootCount; | 96 unsigned m_childShadowRootCount; |
| 97 HeapVector<Member<InsertionPoint>> m_descendantInsertionPoints; | 97 HeapVector<Member<InsertionPoint>> m_descendantInsertionPoints; |
| 98 Member<StyleSheetList> m_styleSheetList; | 98 Member<StyleSheetList> m_styleSheetList; |
| 99 unsigned m_descendantSlotCount; | 99 unsigned m_descendantSlotCount; |
| 100 HeapVector<Member<HTMLSlotElement>> m_descendantSlots; | 100 HeapVector<Member<HTMLSlotElement>> m_descendantSlots; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 inline void ShadowRootRareData::didAddInsertionPoint(InsertionPoint* point) | 103 inline void ShadowRootRareData::didAddInsertionPoint(InsertionPoint* point) |
| 104 { | 104 { |
| 105 ASSERT(point); | 105 DCHECK(point); |
| 106 if (isHTMLShadowElement(*point)) | 106 if (isHTMLShadowElement(*point)) |
| 107 ++m_descendantShadowElementCount; | 107 ++m_descendantShadowElementCount; |
| 108 else if (isHTMLContentElement(*point)) | 108 else if (isHTMLContentElement(*point)) |
| 109 ++m_descendantContentElementCount; | 109 ++m_descendantContentElementCount; |
| 110 else | 110 else |
| 111 ASSERT_NOT_REACHED(); | 111 ASSERT_NOT_REACHED(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 inline void ShadowRootRareData::didRemoveInsertionPoint(InsertionPoint* point) | 114 inline void ShadowRootRareData::didRemoveInsertionPoint(InsertionPoint* point) |
| 115 { | 115 { |
| 116 ASSERT(point); | 116 DCHECK(point); |
| 117 if (isHTMLShadowElement(*point)) { | 117 if (isHTMLShadowElement(*point)) { |
| 118 ASSERT(m_descendantShadowElementCount > 0); | 118 DCHECK_GT(m_descendantShadowElementCount, 0u); |
| 119 --m_descendantShadowElementCount; | 119 --m_descendantShadowElementCount; |
| 120 } else if (isHTMLContentElement(*point)) { | 120 } else if (isHTMLContentElement(*point)) { |
| 121 ASSERT(m_descendantContentElementCount > 0); | 121 DCHECK_GT(m_descendantContentElementCount, 0u); |
| 122 --m_descendantContentElementCount; | 122 --m_descendantContentElementCount; |
| 123 } else { | 123 } else { |
| 124 ASSERT_NOT_REACHED(); | 124 ASSERT_NOT_REACHED(); |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace blink | 128 } // namespace blink |
| 129 | 129 |
| 130 #endif | 130 #endif |
| OLD | NEW |