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

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

Issue 2086013003: Make sure to lazyReattach a distributed node if it is already attached (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
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..0d86721f8884f556cc0296ad22af405e5f60e53e 100644
--- a/third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp
+++ b/third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp
@@ -116,7 +116,7 @@ static void detachNotAssignedNode(Node& node)
void SlotAssignment::resolveAssignment()
{
for (Member<HTMLSlotElement> slot : slots())
- slot->clearDistribution();
+ slot->saveAndClearDistribution();
for (Node& child : NodeTraversal::childrenOf(m_owner->host())) {
if (!child.isSlotable()) {
@@ -140,8 +140,10 @@ void SlotAssignment::resolveDistribution()
slot->resolveDistributedNodes();
// Update each slot's distribution in reverse tree order so that a child slot is visited before its parent slot.
- for (auto slot = slots.rbegin(); slot != slots.rend(); ++slot)
+ for (auto slot = slots.rbegin(); slot != slots.rend(); ++slot) {
(*slot)->updateDistributedNodesWithFallback();
+ (*slot)->lazyReattachDistributedNodesIfNeeded();
+ }
}
const HeapVector<Member<HTMLSlotElement>>& SlotAssignment::slots()
« no previous file with comments | « third_party/WebKit/LayoutTests/shadow-dom/layout-expected.html ('k') | third_party/WebKit/Source/core/html/HTMLSlotElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698