Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp

Issue 1681683005: Set distribution recalc flag when a slot assignment changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-api-dynamic.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/InsertionPoint.h" 11 #include "core/dom/shadow/InsertionPoint.h"
11 #include "core/dom/shadow/ShadowRoot.h" 12 #include "core/dom/shadow/ShadowRoot.h"
12 #include "core/html/HTMLSlotElement.h" 13 #include "core/html/HTMLSlotElement.h"
13 14
14 namespace blink { 15 namespace blink {
15 16
16 HTMLSlotElement* SlotAssignment::assignedSlotFor(const Node& node) const 17 HTMLSlotElement* SlotAssignment::assignedSlotFor(const Node& node) const
17 { 18 {
18 return m_assignment.get(const_cast<Node*>(&node)); 19 return m_assignment.get(const_cast<Node*>(&node));
19 } 20 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 80
80 void SlotAssignment::assign(Node& hostChild, HTMLSlotElement& slot) 81 void SlotAssignment::assign(Node& hostChild, HTMLSlotElement& slot)
81 { 82 {
82 ASSERT(hostChild.isSlotAssignable()); 83 ASSERT(hostChild.isSlotAssignable());
83 m_assignment.add(&hostChild, &slot); 84 m_assignment.add(&hostChild, &slot);
84 slot.appendAssignedNode(hostChild); 85 slot.appendAssignedNode(hostChild);
85 if (isHTMLSlotElement(hostChild)) 86 if (isHTMLSlotElement(hostChild))
86 slot.appendDistributedNodesFrom(toHTMLSlotElement(hostChild)); 87 slot.appendDistributedNodesFrom(toHTMLSlotElement(hostChild));
87 else 88 else
88 slot.appendDistributedNode(hostChild); 89 slot.appendDistributedNode(hostChild);
90 if (slot.isChildOfV1ShadowHost())
91 slot.parentElementShadow()->setNeedsDistributionRecalc();
89 } 92 }
90 93
91 DEFINE_TRACE(SlotAssignment) 94 DEFINE_TRACE(SlotAssignment)
92 { 95 {
93 #if ENABLE(OILPAN) 96 #if ENABLE(OILPAN)
94 visitor->trace(m_assignment); 97 visitor->trace(m_assignment);
95 #endif 98 #endif
96 } 99 }
97 100
98 } // namespace blink 101 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-api-dynamic.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698