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

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: 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/StyleSheetContents.cpp
diff --git a/Source/core/css/StyleSheetContents.cpp b/Source/core/css/StyleSheetContents.cpp
index 98f378dd6abe174e4e4f6569ac238c65a092ba23..ab2038075ef8c5c8300bb439742900ce266dbabd 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());
@@ -588,8 +583,6 @@ void StyleSheetContents::clientLoadStarted(CSSStyleSheet* sheet)
void StyleSheetContents::removeSheetFromCache(Document* document)
{
- if (!maybeCacheable())
- return;
if (!document || !document->isActive())
return;
document->styleEngine()->removeSheet(this);

Powered by Google App Engine
This is Rietveld 408576698