Index: Source/core/dom/StyleEngine.cpp |
diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp |
index d25247045e79e69558b151b2e439ffa065cc32dc..72d3a85f8cc4036ab4ad7f063e38ed1d1fb7b880 100644 |
--- a/Source/core/dom/StyleEngine.cpp |
+++ b/Source/core/dom/StyleEngine.cpp |
@@ -243,7 +243,9 @@ 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); |