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

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

Issue 1106313003: Null check collection handling dirty scopes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed review issues Created 5 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
« no previous file with comments | « LayoutTests/fast/dom/shadow/remove-stylesheet-from-shadow-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/StyleEngine.cpp
diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp
index d25247045e79e69558b151b2e439ffa065cc32dc..09ebb10b0330077e0890d694287eea53e496db35 100644
--- a/Source/core/dom/StyleEngine.cpp
+++ b/Source/core/dom/StyleEngine.cpp
@@ -243,7 +243,8 @@ void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode)
{
ASSERT(styleSheetCandidateNode);
TreeScope* treeScope = isStyleElement(*styleSheetCandidateNode) ? &styleSheetCandidateNode->treeScope() : m_document.get();
- markTreeScopeDirty(*treeScope);
+ if (styleSheetCandidateNode->inDocument())
+ markTreeScopeDirty(*treeScope);
// Make sure we knew this sheet was pending, and that our count isn't out of sync.
ASSERT(m_pendingStylesheets > 0);
@@ -579,6 +580,7 @@ void StyleEngine::markTreeScopeDirty(TreeScope& scope)
return;
}
+ ASSERT(m_styleSheetCollectionMap.contains(&scope));
m_dirtyTreeScopes.add(&scope);
}
« no previous file with comments | « LayoutTests/fast/dom/shadow/remove-stylesheet-from-shadow-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698