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

Unified Diff: third_party/WebKit/Source/core/html/HTMLSlotElement.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
« no previous file with comments | « third_party/WebKit/Source/core/dom/shadow/SlotAssignment.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 42ce6cf622668590db098c89ec3fd8a3b9d03fd9..29d2b84025feca3b478974d43e9b7484218dcd2f 100644
--- a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
@@ -204,8 +204,8 @@ void HTMLSlotElement::attributeChanged(
if (params.name == nameAttr) {
if (ShadowRoot* root = containingShadowRoot()) {
if (root->isV1() && params.oldValue != params.newValue) {
- root->ensureSlotAssignment().slotRenamed(
- normalizeSlotName(params.oldValue), *this);
+ root->slotAssignment().slotRenamed(normalizeSlotName(params.oldValue),
+ *this);
}
}
}
@@ -232,7 +232,7 @@ Node::InsertionNotificationRequest HTMLSlotElement::insertedInto(
// - 6.4: Run assign slotables for a tree with node's tree and a set
// containing each inclusive descendant of node that is a slot.
if (root->isV1() && !wasInShadowTreeBeforeInserted(*this, *insertionPoint))
- root->ensureSlotAssignment().slotAdded(*this);
+ root->didAddSlot(*this);
}
// We could have been distributed into in a detached subtree, make sure to
@@ -272,7 +272,7 @@ void HTMLSlotElement::removedFrom(ContainerNode* insertionPoint) {
if (root && root->isV1() && root == insertionPoint->treeScope().rootNode()) {
// This slot was in a shadow tree and got disconnected from the shadow root.
- root->ensureSlotAssignment().slotRemoved(*this);
+ root->slotAssignment().slotRemoved(*this);
}
HTMLElement::removedFrom(insertionPoint);
@@ -340,7 +340,7 @@ bool HTMLSlotElement::hasAssignedNodesSlow() const {
ShadowRoot* root = containingShadowRoot();
DCHECK(root);
DCHECK(root->isV1());
- SlotAssignment& assignment = root->ensureSlotAssignment();
+ SlotAssignment& assignment = root->slotAssignment();
if (assignment.findSlotByName(name()) != this)
return false;
return assignment.findHostChildBySlotName(name());
@@ -350,7 +350,7 @@ bool HTMLSlotElement::findHostChildWithSameSlotName() const {
ShadowRoot* root = containingShadowRoot();
DCHECK(root);
DCHECK(root->isV1());
- SlotAssignment& assignment = root->ensureSlotAssignment();
+ SlotAssignment& assignment = root->slotAssignment();
return assignment.findHostChildBySlotName(name());
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698