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

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

Issue 2315923002: Lazy Parse CSS (Closed)
Patch Set: s/->/. Created 4 years, 3 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: third_party/WebKit/Source/core/css/StyleSheetContents.cpp
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
index 9ad890082c3cc4b20fc52366b5317ba5fd16ad06..93123fb8fddb5cd54c98db6c00adf95bf45937d3 100644
--- a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
+++ b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
@@ -86,6 +86,8 @@ StyleSheetContents::StyleSheetContents(const StyleSheetContents& o)
, m_hasSingleOwnerDocument(true)
, m_isUsedFromTextCache(false)
, m_parserContext(o.m_parserContext)
+ , m_escapedStrings(o.m_escapedStrings ? new Vector<String>(*o.m_escapedStrings) : nullptr)
+ , m_sheetText(o.m_sheetText)
{
// FIXME: Copy import rules.
ASSERT(o.m_importRules.isEmpty());
@@ -333,6 +335,8 @@ void StyleSheetContents::parseAuthorStyleSheet(const CSSStyleSheetResource* cach
CSSStyleSheetResource::MIMETypeCheck mimeTypeCheck = isQuirksModeBehavior(m_parserContext.mode()) && isSameOriginRequest ? CSSStyleSheetResource::MIMETypeCheck::Lax : CSSStyleSheetResource::MIMETypeCheck::Strict;
String sheetText = cachedStyleSheet->sheetText(mimeTypeCheck);
+ if (RuntimeEnabledFeatures::lazyParseCSSEnabled())
+ m_sheetText = sheetText;
const ResourceResponse& response = cachedStyleSheet->response();
m_sourceMapURL = response.httpHeaderField(HTTPNames::SourceMap);
@@ -342,7 +346,7 @@ void StyleSheetContents::parseAuthorStyleSheet(const CSSStyleSheetResource* cach
}
CSSParserContext context(parserContext(), UseCounter::getFrom(this));
- CSSParser::parseSheet(context, this, sheetText);
+ CSSParser::parseSheet(context, this, sheetText, RuntimeEnabledFeatures::lazyParseCSSEnabled());
}
void StyleSheetContents::parseString(const String& sheetText)
@@ -474,7 +478,7 @@ static bool childRulesHaveFailedOrCanceledSubresources(const HeapVector<Member<S
const StyleRuleBase* rule = rules[i].get();
switch (rule->type()) {
case StyleRuleBase::Style:
- if (toStyleRule(rule)->properties().hasFailedOrCanceledSubresources())
+ if (toStyleRule(rule)->propertiesHaveFailedOrCanceledSubresources())
return true;
break;
case StyleRuleBase::FontFace:

Powered by Google App Engine
This is Rietveld 408576698