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

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

Issue 2452473003: Do not use outdated m_distributedNodes of slots in non-shadow trees (Closed)
Patch Set: update 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/dom/Node.cpp ('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 1b8b7bfef1748291b272b08414b4104872c304d9..21250c6778eb177957f7c271565fd89c43ac5f69 100644
--- a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
@@ -97,6 +97,8 @@ void HTMLSlotElement::updateDistributedNodesManually() {
const HeapVector<Member<Node>>& HTMLSlotElement::getDistributedNodes() {
DCHECK(!needsDistributionRecalc());
+ // m_distributedNodes of slots in non-shadow trees are not updated in recalc
+ // distribution flow.
if (!supportsDistribution())
updateDistributedNodesManually();
return m_distributedNodes;
@@ -178,7 +180,7 @@ AtomicString HTMLSlotElement::name() const {
}
void HTMLSlotElement::attachLayoutTree(const AttachContext& context) {
- for (auto& node : m_distributedNodes) {
+ for (auto& node : getDistributedNodes()) {
if (node->needsAttach())
node->attachLayoutTree(context);
}
@@ -317,6 +319,8 @@ void HTMLSlotElement::enqueueSlotChangeEvent() {
}
ShadowRoot* root = containingShadowRoot();
+ // TODO(hayato): Relax this check if slots in non-shadow trees are well
+ // supported.
DCHECK(root);
DCHECK(root->isV1());
root->owner()->setNeedsDistributionRecalc();
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698