| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | |
| 3 * | |
| 4 * Redistribution and use in source and binary forms, with or without | |
| 5 * modification, are permitted provided that the following conditions are | |
| 6 * met: | |
| 7 * | |
| 8 * * Redistributions of source code must retain the above copyright | |
| 9 * notice, this list of conditions and the following disclaimer. | |
| 10 * * Redistributions in binary form must reproduce the above | |
| 11 * copyright notice, this list of conditions and the following disclaimer | |
| 12 * in the documentation and/or other materials provided with the | |
| 13 * distribution. | |
| 14 * * Neither the name of Google Inc. nor the names of its | |
| 15 * contributors may be used to endorse or promote products derived from | |
| 16 * this software without specific prior written permission. | |
| 17 * | |
| 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 29 */ | |
| 30 | |
| 31 #ifndef ShadowRootRareData_h | |
| 32 #define ShadowRootRareData_h | |
| 33 | |
| 34 #include "core/dom/shadow/InsertionPoint.h" | |
| 35 #include "core/html/HTMLSlotElement.h" | |
| 36 #include "wtf/Vector.h" | |
| 37 | |
| 38 namespace blink { | |
| 39 | |
| 40 class ShadowRootRareData : public GarbageCollected<ShadowRootRareData> { | |
| 41 public: | |
| 42 ShadowRootRareData() | |
| 43 : m_childShadowRootCount(0) | |
| 44 , m_descendantSlotCount(0) | |
| 45 { | |
| 46 } | |
| 47 | |
| 48 bool containsShadowRoots() const { return m_childShadowRootCount; } | |
| 49 | |
| 50 void didAddChildShadowRoot() { ++m_childShadowRootCount; } | |
| 51 void didRemoveChildShadowRoot() { DCHECK_GT(m_childShadowRootCount, 0u); --m
_childShadowRootCount; } | |
| 52 | |
| 53 unsigned childShadowRootCount() const { return m_childShadowRootCount; } | |
| 54 | |
| 55 StyleSheetList* styleSheets() { return m_styleSheetList.get(); } | |
| 56 void setStyleSheets(StyleSheetList* styleSheetList) { m_styleSheetList = sty
leSheetList; } | |
| 57 | |
| 58 void didAddSlot() { ++m_descendantSlotCount; } | |
| 59 void didRemoveSlot() { DCHECK_GT(m_descendantSlotCount, 0u); --m_descendantS
lotCount; } | |
| 60 | |
| 61 unsigned descendantSlotCount() const { return m_descendantSlotCount; } | |
| 62 | |
| 63 const HeapVector<Member<HTMLSlotElement>>& descendantSlots() const { return
m_descendantSlots; } | |
| 64 | |
| 65 void setDescendantSlots(HeapVector<Member<HTMLSlotElement>>& slots) { m_desc
endantSlots.swap(slots); } | |
| 66 void clearDescendantSlots() { m_descendantSlots.clear(); } | |
| 67 | |
| 68 DEFINE_INLINE_TRACE() | |
| 69 { | |
| 70 visitor->trace(m_styleSheetList); | |
| 71 visitor->trace(m_descendantSlots); | |
| 72 } | |
| 73 | |
| 74 private: | |
| 75 unsigned m_childShadowRootCount; | |
| 76 Member<StyleSheetList> m_styleSheetList; | |
| 77 unsigned m_descendantSlotCount; | |
| 78 HeapVector<Member<HTMLSlotElement>> m_descendantSlots; | |
| 79 }; | |
| 80 | |
| 81 } // namespace blink | |
| 82 | |
| 83 #endif | |
| OLD | NEW |