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

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

Issue 2315923002: Lazy Parse CSS (Closed)
Patch Set: Remove the closure and refactor logic into a separate file Created 4 years, 2 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 6d642af4888d5b79bc5cac7c863150036f994e5a..8efbdbb15a1dffc0b069af4b59212a5d10146a10 100644
--- a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
+++ b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
@@ -90,6 +90,8 @@ StyleSheetContents::StyleSheetContents(const StyleSheetContents& o)
// FIXME: Copy import rules.
ASSERT(o.m_importRules.isEmpty());
+ // LazyParseCSS: Copying child rules is a strict point for lazy parsing, so
+ // there is no need to copy lazy parsing state here.
for (unsigned i = 0; i < m_childRules.size(); ++i)
m_childRules[i] = o.m_childRules[i]->copy();
}
@@ -349,7 +351,8 @@ void StyleSheetContents::parseAuthorStyleSheet(
}
CSSParserContext context(parserContext(), UseCounter::getFrom(this));
- CSSParser::parseSheet(context, this, sheetText);
+ CSSParser::parseSheet(context, this, sheetText,
+ RuntimeEnabledFeatures::lazyParseCSSEnabled());
esprehn 2016/10/24 21:20:20 Can we check this flag from inside parseSheet inst
Charlie Harrison 2016/10/25 15:56:55 It's a bit tricky and involves tradeoffs. Passing
}
void StyleSheetContents::parseString(const String& sheetText) {
@@ -476,7 +479,7 @@ static bool childRulesHaveFailedOrCanceledSubresources(
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