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

Unified Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2630293003: Do not allocate SlotAssignment unless a shadowroot has a slot (Closed)
Patch Set: renamed Created 3 years, 11 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/Node.cpp
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index 600af2f195aadbeb1136ad3b602b9d93b4d01122..f4a1c8ffa325fb6649dd4a79a1a6c9a3a04773be 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -2321,7 +2321,7 @@ HTMLSlotElement* Node::assignedSlot() const {
// assignedSlot doesn't need to call updateDistribution().
DCHECK(!isPseudoElement());
if (ShadowRoot* root = v1ShadowRootOfParent())
- return root->ensureSlotAssignment().findSlot(*this);
+ return root->assignedSlotFor(*this);
return nullptr;
}
@@ -2329,7 +2329,7 @@ HTMLSlotElement* Node::assignedSlotForBinding() {
// assignedSlot doesn't need to call updateDistribution().
if (ShadowRoot* root = v1ShadowRootOfParent()) {
if (root->type() == ShadowRootType::Open)
- return root->ensureSlotAssignment().findSlot(*this);
+ return root->assignedSlotFor(*this);
}
return nullptr;
}
@@ -2452,7 +2452,7 @@ void Node::checkSlotChange(SlotChangeType slotChangeType) {
// Although DOM Standard requires "assign a slot for node / run assign
// slotables" at this timing, we skip it as an optimization.
- if (HTMLSlotElement* slot = root->ensureSlotAssignment().findSlot(*this))
+ if (HTMLSlotElement* slot = root->assignedSlotFor(*this))
slot->didSlotChange(slotChangeType);
} else {
// Relevant DOM Standard:
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698