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 #include "core/dom/shadow/SlotAssignment.h" | 5 #include "core/dom/shadow/SlotAssignment.h" |
6 | 6 |
7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
8 #include "core/dom/ElementTraversal.h" | 8 #include "core/dom/ElementTraversal.h" |
9 #include "core/dom/NodeTraversal.h" | 9 #include "core/dom/NodeTraversal.h" |
10 #include "core/dom/shadow/ElementShadow.h" | 10 #include "core/dom/shadow/ElementShadow.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 Name2Slot name2slot; | 33 Name2Slot name2slot; |
34 | 34 |
35 const HeapVector<Member<HTMLSlotElement>>& slots = shadowRoot.descendantSlot s(); | 35 const HeapVector<Member<HTMLSlotElement>>& slots = shadowRoot.descendantSlot s(); |
36 | 36 |
37 for (Member<HTMLSlotElement> slot : slots) { | 37 for (Member<HTMLSlotElement> slot : slots) { |
38 slot->willUpdateDistribution(); | 38 slot->willUpdateDistribution(); |
39 name2slot.add(slot->name(), slot.get()); | 39 name2slot.add(slot->name(), slot.get()); |
40 } | 40 } |
41 | 41 |
42 for (Node& child : NodeTraversal::childrenOf(*shadowRoot.host())) { | 42 for (Node& child : NodeTraversal::childrenOf(*shadowRoot.host())) { |
43 if (child.isElementNode() && isActiveInsertionPoint(child)) { | 43 if (child.isInsertionPoint()) { |
hayato
2016/04/11 09:34:40
Strictly speaking, this is the behavior change. Ho
kochi
2016/04/11 10:35:33
Acknowledged.
| |
44 // TODO(hayato): Support re-distribution across v0 and v1 shadow tre es | 44 // A re-distribution across v0 and v1 shadow trees is not supported. |
45 detachNotAssignedNode(child); | 45 detachNotAssignedNode(child); |
46 continue; | 46 continue; |
47 } | 47 } |
48 if (!child.slottable()) { | 48 if (!child.slottable()) { |
49 detachNotAssignedNode(child); | 49 detachNotAssignedNode(child); |
50 continue; | 50 continue; |
51 } | 51 } |
52 AtomicString slotName = child.slotName(); | 52 AtomicString slotName = child.slotName(); |
53 HTMLSlotElement* slot = name2slot.get(slotName); | 53 HTMLSlotElement* slot = name2slot.get(slotName); |
54 if (slot) | 54 if (slot) |
(...skipping 21 matching lines...) Expand all Loading... | |
76 if (slot.isChildOfV1ShadowHost()) | 76 if (slot.isChildOfV1ShadowHost()) |
77 slot.parentElementShadow()->setNeedsDistributionRecalc(); | 77 slot.parentElementShadow()->setNeedsDistributionRecalc(); |
78 } | 78 } |
79 | 79 |
80 DEFINE_TRACE(SlotAssignment) | 80 DEFINE_TRACE(SlotAssignment) |
81 { | 81 { |
82 visitor->trace(m_assignment); | 82 visitor->trace(m_assignment); |
83 } | 83 } |
84 | 84 |
85 } // namespace blink | 85 } // namespace blink |
OLD | NEW |