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

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

Issue 2089063005: Schedule sibling invalidation sets for sibling insert/remove. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed minDirectAdjacent optimization. Created 4 years, 6 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 4d379568e1dbac73b9b58710f82c9fede316ace2..5e7237bc79863efecfebd026872fbfdb7462ca25 100644
--- a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
+++ b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
@@ -150,6 +150,13 @@ void ShadowRoot::attach(const AttachContext& context)
DocumentFragment::attach(context);
}
+void ShadowRoot::detach(const AttachContext& context)
+{
+ if (context.clearInvalidation)
+ document().styleEngine().styleInvalidator().clearInvalidation(*this);
+ DocumentFragment::detach(context);
+}
+
Node::InsertionNotificationRequest ShadowRoot::insertedInto(ContainerNode* insertionPoint)
{
DocumentFragment::insertedInto(insertionPoint);
@@ -183,6 +190,8 @@ void ShadowRoot::removedFrom(ContainerNode* insertionPoint)
root->removeChildShadowRoot();
m_registeredWithParentShadowRoot = false;
}
+ if (needsStyleInvalidation())
+ document().styleEngine().styleInvalidator().clearInvalidation(*this);
}
DocumentFragment::removedFrom(insertionPoint);
@@ -193,7 +202,7 @@ void ShadowRoot::childrenChanged(const ChildrenChange& change)
ContainerNode::childrenChanged(change);
if (change.isChildElementChange())
- checkForSiblingStyleChanges(change.type == ElementRemoved ? SiblingElementRemoved : SiblingElementInserted, change.siblingBeforeChange, change.siblingAfterChange);
+ checkForSiblingStyleChanges(change.type == ElementRemoved ? SiblingElementRemoved : SiblingElementInserted, change.siblingChanged, change.siblingBeforeChange, change.siblingAfterChange);
if (InsertionPoint* point = shadowInsertionPointOfYoungerShadowRoot()) {
if (ShadowRoot* root = point->containingShadowRoot())

Powered by Google App Engine
This is Rietveld 408576698