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

Unified Diff: Source/core/dom/StyleElement.cpp

Issue 980343002: Skip removal of stylesheet candidate node if not added. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/StyleElement.cpp
diff --git a/Source/core/dom/StyleElement.cpp b/Source/core/dom/StyleElement.cpp
index 112e68c90e6f22b6d5112573090019d7d3cc1a94..dcc88555d4f28e4e233132973b7081c44a20dd8d 100644
--- a/Source/core/dom/StyleElement.cpp
+++ b/Source/core/dom/StyleElement.cpp
@@ -114,10 +114,9 @@ void StyleElement::clearDocumentData(Document& document, Element* element)
if (m_sheet)
m_sheet->clearOwnerNode();
- if (element->inDocument()) {
- // HTMLLinkElement in shadow tree is not supported.
- TreeScope& treeScope = isHTMLStyleElement(element) || isSVGStyleElement(element) ? element->treeScope() : element->document();
- document.styleEngine().removeStyleSheetCandidateNode(element, treeScope);
+ if (m_registeredAsCandidate) {
+ ASSERT(element->inDocument());
+ document.styleEngine().removeStyleSheetCandidateNode(element, element->treeScope());
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698