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

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

Issue 2554873002: Mark correct tree-scope dirty removing link in shadow. (Closed)
Patch Set: Rebased Created 4 years 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/StyleEngine.cpp
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
index c34438007902b7978798d93f15501be8bc43cfc5..4f43661a933f6f53667016f3a3e4ce86300b14ef 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -220,14 +220,17 @@ void StyleEngine::addStyleSheetCandidateNode(Node& node) {
m_activeTreeScopes.add(&treeScope);
}
-void StyleEngine::removeStyleSheetCandidateNode(Node& node) {
- removeStyleSheetCandidateNode(node, *m_document);
-}
-
void StyleEngine::removeStyleSheetCandidateNode(Node& node,
- TreeScope& treeScope) {
+ ContainerNode& insertionPoint) {
DCHECK(!isXSLStyleSheet(node));
+ DCHECK(insertionPoint.isConnected());
+
+ ShadowRoot* shadowRoot = node.containingShadowRoot();
+ if (!shadowRoot)
+ shadowRoot = insertionPoint.containingShadowRoot();
+ TreeScope& treeScope =
+ shadowRoot ? *toTreeScope(shadowRoot) : toTreeScope(document());
TreeScopeStyleSheetCollection* collection =
styleSheetCollectionFor(treeScope);
// After detaching document, collection could be null. In the case,
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/core/html/HTMLLinkElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698