| 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" |
| 11 #include "wtf/HashMap.h" | 11 #include "wtf/HashMap.h" |
| 12 #include "wtf/text/AtomicString.h" | 12 #include "wtf/text/AtomicString.h" |
| 13 #include "wtf/text/AtomicStringHash.h" | 13 #include "wtf/text/AtomicStringHash.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class HTMLSlotElement; | 17 class HTMLSlotElement; |
| 18 class Node; | 18 class Node; |
| 19 class ShadowRoot; | 19 class ShadowRoot; |
| 20 | 20 |
| 21 // TODO(hayato): Support SlotAssignment for non-shadow trees, e.g. a document tr
ee. | 21 // TODO(hayato): Support SlotAssignment for non-shadow trees, e.g. a document |
| 22 // tree. |
| 22 class SlotAssignment final : public GarbageCollected<SlotAssignment> { | 23 class SlotAssignment final : public GarbageCollected<SlotAssignment> { |
| 23 public: | 24 public: |
| 24 static SlotAssignment* create(ShadowRoot& owner) { | 25 static SlotAssignment* create(ShadowRoot& owner) { |
| 25 return new SlotAssignment(owner); | 26 return new SlotAssignment(owner); |
| 26 } | 27 } |
| 27 | 28 |
| 28 // Relevant DOM Standard: https://dom.spec.whatwg.org/#find-a-slot | 29 // Relevant DOM Standard: https://dom.spec.whatwg.org/#find-a-slot |
| 29 HTMLSlotElement* findSlot(const Node&); | 30 HTMLSlotElement* findSlot(const Node&); |
| 30 HTMLSlotElement* findSlotByName(const AtomicString& slotName); | 31 HTMLSlotElement* findSlotByName(const AtomicString& slotName); |
| 31 | 32 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 62 HeapVector<Member<HTMLSlotElement>> m_slots; | 63 HeapVector<Member<HTMLSlotElement>> m_slots; |
| 63 Member<DocumentOrderedMap> m_slotMap; | 64 Member<DocumentOrderedMap> m_slotMap; |
| 64 WeakMember<ShadowRoot> m_owner; | 65 WeakMember<ShadowRoot> m_owner; |
| 65 unsigned m_needsCollectSlots : 1; | 66 unsigned m_needsCollectSlots : 1; |
| 66 unsigned m_slotCount : 31; | 67 unsigned m_slotCount : 31; |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 } // namespace blink | 70 } // namespace blink |
| 70 | 71 |
| 71 #endif // HTMLSlotAssignment_h | 72 #endif // HTMLSlotAssignment_h |
| OLD | NEW |