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

Unified Diff: third_party/WebKit/Source/core/html/HTMLSlotElement.cpp

Issue 2427443003: Reland of Fix FlatTreeTraversal for a slot in a document tree (Closed)
Patch Set: Created 4 years, 2 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/Source/core/html/HTMLSlotElement.h ('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/html/HTMLSlotElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp b/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
index 2d4113e136e7c9ab5a5cdfb8ad5d75d4a3e4d083..1b8b7bfef1748291b272b08414b4104872c304d9 100644
--- a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
@@ -72,11 +72,8 @@
return m_assignedNodes;
}
-const HeapVector<Member<Node>>& HTMLSlotElement::getDistributedNodes() {
- DCHECK(!needsDistributionRecalc());
- if (isInShadowTree())
- return m_distributedNodes;
-
+void HTMLSlotElement::updateDistributedNodesManually() {
+ DCHECK(!supportsDistribution());
// A slot is unlikely to be used outside of a shadow tree.
// We do not need to optimize this case in most cases.
// TODO(hayato): If this path causes a performance issue, we should move
@@ -96,6 +93,12 @@
child = NodeTraversal::nextSkippingChildren(*child, this);
}
}
+}
+
+const HeapVector<Member<Node>>& HTMLSlotElement::getDistributedNodes() {
+ DCHECK(!needsDistributionRecalc());
+ if (!supportsDistribution())
+ updateDistributedNodesManually();
return m_distributedNodes;
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSlotElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698