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

Unified Diff: Source/core/css/CSSStyleSheet.cpp

Issue 204423002: Should remove StyleSheetContents from cache even if document is not active. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
Index: Source/core/css/CSSStyleSheet.cpp
diff --git a/Source/core/css/CSSStyleSheet.cpp b/Source/core/css/CSSStyleSheet.cpp
index 42fcb47534f9b0d73e4157eb5ea9fe528339091e..1d0336a5c5a0d6342a1173457e7bafa96b4ae1cf 100644
--- a/Source/core/css/CSSStyleSheet.cpp
+++ b/Source/core/css/CSSStyleSheet.cpp
@@ -162,7 +162,8 @@ void CSSStyleSheet::willMutateRules()
// If we are the only client it is safe to mutate.
if (m_contents->clientSize() <= 1 && !m_contents->isInMemoryCache()) {
m_contents->clearRuleSet();
- m_contents->removeSheetFromCache(ownerDocument());
+ if (Document* document = ownerDocument())
+ m_contents->removeSheetFromCache(document);
m_contents->setMutable();
return;
}

Powered by Google App Engine
This is Rietveld 408576698