| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SlotAssignment_h | 5 #ifndef SlotAssignment_h |
| 6 #define SlotAssignment_h | 6 #define SlotAssignment_h |
| 7 | 7 |
| 8 // #include "core/dom/DocumentOrderedList.h" | 8 // #include "core/dom/DocumentOrderedList.h" |
| 9 #include "core/dom/DocumentOrderedMap.h" | 9 #include "core/dom/DocumentOrderedMap.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // void assignSlot(const Node& slottable); | 35 // void assignSlot(const Node& slottable); |
| 36 // 2. https://dom.spec.whatwg.org/#assign-slotables | 36 // 2. https://dom.spec.whatwg.org/#assign-slotables |
| 37 // void assignSlotables(HTMLSlotElement&); | 37 // void assignSlotables(HTMLSlotElement&); |
| 38 // As an optimization, Blink does not implement these literally. | 38 // As an optimization, Blink does not implement these literally. |
| 39 // Instead, provide alternative, HTMLSlotElement::hasAssignedNodesSlow() | 39 // Instead, provide alternative, HTMLSlotElement::hasAssignedNodesSlow() |
| 40 // so that slotchange can be detected. | 40 // so that slotchange can be detected. |
| 41 | 41 |
| 42 void resolveDistribution(); | 42 void resolveDistribution(); |
| 43 const HeapVector<Member<HTMLSlotElement>>& slots(); | 43 const HeapVector<Member<HTMLSlotElement>>& slots(); |
| 44 | 44 |
| 45 void slotAdded(HTMLSlotElement&); | 45 void didAddSlot(HTMLSlotElement&); |
| 46 void slotRemoved(HTMLSlotElement&); | 46 void slotRemoved(HTMLSlotElement&); |
| 47 void slotRenamed(const AtomicString& oldName, HTMLSlotElement&); | 47 void slotRenamed(const AtomicString& oldName, HTMLSlotElement&); |
| 48 void hostChildSlotNameChanged(const AtomicString& oldValue, | 48 void didChangeHostChildSlotName(const AtomicString& oldValue, |
| 49 const AtomicString& newValue); | 49 const AtomicString& newValue); |
| 50 | 50 |
| 51 bool findHostChildBySlotName(const AtomicString& slotName) const; | 51 bool findHostChildBySlotName(const AtomicString& slotName) const; |
| 52 | 52 |
| 53 DECLARE_TRACE(); | 53 DECLARE_TRACE(); |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 explicit SlotAssignment(ShadowRoot& owner); | 56 explicit SlotAssignment(ShadowRoot& owner); |
| 57 | 57 |
| 58 void collectSlots(); | 58 void collectSlots(); |
| 59 | 59 |
| 60 void resolveAssignment(); | 60 void resolveAssignment(); |
| 61 void distributeTo(Node&, HTMLSlotElement&); | 61 void distributeTo(Node&, HTMLSlotElement&); |
| 62 | 62 |
| 63 HeapVector<Member<HTMLSlotElement>> m_slots; | 63 HeapVector<Member<HTMLSlotElement>> m_slots; |
| 64 Member<DocumentOrderedMap> m_slotMap; | 64 Member<DocumentOrderedMap> m_slotMap; |
| 65 WeakMember<ShadowRoot> m_owner; | 65 WeakMember<ShadowRoot> m_owner; |
| 66 unsigned m_needsCollectSlots : 1; | 66 unsigned m_needsCollectSlots : 1; |
| 67 unsigned m_slotCount : 31; | 67 unsigned m_slotCount : 31; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace blink | 70 } // namespace blink |
| 71 | 71 |
| 72 #endif // HTMLSlotAssignment_h | 72 #endif // HTMLSlotAssignment_h |
| OLD | NEW |