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

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

Issue 1899653002: Support slotchange event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/ShadowRoot.cpp
diff --git a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
index 1b204033c8bd1438d39c6d504460ad665338afa1..1f8e177be8841c4cb229f92dc91bb2caef731122 100644
--- a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
+++ b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
@@ -126,6 +126,8 @@ void ShadowRoot::attach(const AttachContext& context)
Node::InsertionNotificationRequest ShadowRoot::insertedInto(ContainerNode* insertionPoint)
{
DocumentFragment::insertedInto(insertionPoint);
+ if (isV1())
+ document().updateAssignment();
if (!insertionPoint->inShadowIncludingDocument() || !isOldest())
return InsertionDone;
@@ -141,6 +143,7 @@ Node::InsertionNotificationRequest ShadowRoot::insertedInto(ContainerNode* inser
m_registeredWithParentShadowRoot = true;
}
+
return InsertionDone;
}
@@ -169,8 +172,11 @@ void ShadowRoot::childrenChanged(const ChildrenChange& change)
checkForSiblingStyleChanges(change.type == ElementRemoved ? SiblingElementRemoved : SiblingElementInserted, change.siblingBeforeChange, change.siblingAfterChange);
if (InsertionPoint* point = shadowInsertionPointOfYoungerShadowRoot()) {
- if (ShadowRoot* root = point->containingShadowRoot())
+ if (ShadowRoot* root = point->containingShadowRoot()) {
root->owner()->setNeedsDistributionRecalc();
+ if (document().shadowCascadeOrder() == ShadowCascadeOrder::ShadowCascadeV1)
+ document().updateAssignment();
+ }
}
}
@@ -334,13 +340,20 @@ const HeapVector<Member<HTMLSlotElement>>& ShadowRoot::descendantSlots()
return m_shadowRootRareData->descendantSlots();
}
-void ShadowRoot::distributeV1()
+void ShadowRoot::assignV1()
{
if (!m_slotAssignment)
m_slotAssignment = SlotAssignment::create();
m_slotAssignment->resolveAssignment(*this);
}
+void ShadowRoot::distributeV1()
+{
+ if (!m_slotAssignment)
+ m_slotAssignment = SlotAssignment::create();
+ m_slotAssignment->resolveDistribution(*this);
+}
+
DEFINE_TRACE(ShadowRoot)
{
visitor->trace(m_prev);

Powered by Google App Engine
This is Rietveld 408576698