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

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

Issue 2085853004: Force reattach all shadow host's children (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/shadow-dom/layout-update-on-slotassignment.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp
diff --git a/third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp b/third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp
index b5fed59b881b23561c5d6f9185e3742f14139b20..284d80c7467e051201ed571117bb034697fe59d8 100644
--- a/third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp
+++ b/third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp
@@ -107,27 +107,19 @@ SlotAssignment::SlotAssignment(ShadowRoot& owner)
{
}
-static void detachNotAssignedNode(Node& node)
-{
- if (node.layoutObject())
- node.lazyReattachIfAttached();
-}
-
void SlotAssignment::resolveAssignment()
{
for (Member<HTMLSlotElement> slot : slots())
slot->clearDistribution();
for (Node& child : NodeTraversal::childrenOf(m_owner->host())) {
- if (!child.isSlotable()) {
- detachNotAssignedNode(child);
+ if (child.layoutObject())
+ child.lazyReattachIfAttached();
+ if (!child.isSlotable())
continue;
- }
HTMLSlotElement* slot = findSlotByName(child.slotName());
if (slot)
slot->appendAssignedNode(child);
- else
- detachNotAssignedNode(child);
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/shadow-dom/layout-update-on-slotassignment.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698