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); |
} |