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

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

Issue 196133034: Move inline stylesheet cache decision making from StyleSheetContents to StyleEngine (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged to trunk 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
« no previous file with comments | « Source/core/css/StyleSheetContents.h ('k') | Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StyleSheetContents.cpp
diff --git a/Source/core/css/StyleSheetContents.cpp b/Source/core/css/StyleSheetContents.cpp
index 4da073aac9fe6ca858baf124ee9303ec70adb4eb..3903c26bc179a3c932d530e759c12675717ea6e5 100644
--- a/Source/core/css/StyleSheetContents.cpp
+++ b/Source/core/css/StyleSheetContents.cpp
@@ -113,8 +113,11 @@ void StyleSheetContents::setHasSyntacticallyValidCSSHeader(bool isValidCss)
m_hasSyntacticallyValidCSSHeader = isValidCss;
}
-bool StyleSheetContents::maybeCacheable() const
+bool StyleSheetContents::isCacheable() const
{
+ // This would require dealing with multiple clients for load callbacks.
+ if (!loadCompleted())
+ return false;
// FIXME: StyleSheets with media queries can't be cached because their RuleSet
// is processed differently based off the media queries, which might resolve
// differently depending on the context of the parent CSSStyleSheet (e.g.
@@ -140,14 +143,6 @@ bool StyleSheetContents::maybeCacheable() const
return true;
}
-bool StyleSheetContents::isCacheable() const
-{
- // This would require dealing with multiple clients for load callbacks.
- if (!loadCompleted())
- return false;
- return maybeCacheable();
-}
-
void StyleSheetContents::parserAppendRule(PassRefPtrWillBeRawPtr<StyleRuleBase> rule)
{
ASSERT(!rule->isCharsetRule());
@@ -589,8 +584,6 @@ void StyleSheetContents::clientLoadStarted(CSSStyleSheet* sheet)
void StyleSheetContents::removeSheetFromCache(Document* document)
{
ASSERT(document);
- if (!maybeCacheable())
- return;
document->styleEngine()->removeSheet(this);
}
« no previous file with comments | « Source/core/css/StyleSheetContents.h ('k') | Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698