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

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

Issue 2472973002: Link stylesheets in shadow trees do not belong to document scope. (Closed)
Patch Set: Rebased Created 4 years, 1 month 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/LayoutTests/shadow-dom/crashes/link-style-change-href-assert.html ('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/dom/StyleEngine.cpp
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
index 701d7a59f70f72e34287e560014b5e012dc95393..683057e1873132b9a505c9ada9702a6d8c88f320 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -82,10 +82,6 @@ StyleEngine::StyleEngine(Document& document)
StyleEngine::~StyleEngine() {}
-static bool isStyleElement(Node& node) {
- return isHTMLStyleElement(node) || isSVGStyleElement(node);
-}
-
inline Document* StyleEngine::master() {
if (isMaster())
return m_document;
@@ -160,11 +156,8 @@ void StyleEngine::addPendingSheet(StyleEngineContext& context) {
// This method is called whenever a top-level stylesheet has finished loading.
void StyleEngine::removePendingSheet(Node& styleSheetCandidateNode,
const StyleEngineContext& context) {
- TreeScope* treeScope = isStyleElement(styleSheetCandidateNode)
- ? &styleSheetCandidateNode.treeScope()
- : m_document.get();
if (styleSheetCandidateNode.isConnected())
- markTreeScopeDirty(*treeScope);
+ markTreeScopeDirty(styleSheetCandidateNode.treeScope());
if (context.addedPendingSheetBeforeBody()) {
DCHECK_GT(m_pendingRenderBlockingStylesheets, 0);
@@ -194,12 +187,8 @@ void StyleEngine::setNeedsActiveStyleUpdate(
if (sheet && document().isActive()) {
Node* node = sheet->ownerNode();
- if (node && node->isConnected()) {
- TreeScope& treeScope =
- isStyleElement(*node) ? node->treeScope() : *m_document;
- DCHECK(isStyleElement(*node) || node->treeScope() == m_document);
- markTreeScopeDirty(treeScope);
- }
+ if (node && node->isConnected())
+ markTreeScopeDirty(node->treeScope());
}
resolverChanged(updateMode);
@@ -227,7 +216,6 @@ void StyleEngine::removeStyleSheetCandidateNode(Node& node) {
void StyleEngine::removeStyleSheetCandidateNode(Node& node,
TreeScope& treeScope) {
- DCHECK(isStyleElement(node) || treeScope == m_document);
DCHECK(!isXSLStyleSheet(node));
TreeScopeStyleSheetCollection* collection =
@@ -245,9 +233,7 @@ void StyleEngine::modifiedStyleSheetCandidateNode(Node& node) {
if (!node.isConnected())
return;
- TreeScope& treeScope = isStyleElement(node) ? node.treeScope() : *m_document;
- DCHECK(isStyleElement(node) || treeScope == m_document);
- markTreeScopeDirty(treeScope);
+ markTreeScopeDirty(node.treeScope());
resolverChanged(AnalyzedStyleUpdate);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/shadow-dom/crashes/link-style-change-href-assert.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698