Index: third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp |
diff --git a/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp b/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp |
index b3d2ec5c849fbab7c3acbfb27b276ed83b41b87b..53e53ef7bdf4b206e654c6fa16495958c6b6d588 100644 |
--- a/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp |
+++ b/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp |
@@ -12,11 +12,9 @@ |
namespace blink { |
CSSLazyParsingState::CSSLazyParsingState(const CSSParserContext& context, |
- Vector<String> escapedStrings, |
const String& sheetText, |
StyleSheetContents* contents) |
: m_context(context), |
- m_escapedStrings(std::move(escapedStrings)), |
m_sheetText(sheetText), |
m_owningContents(contents), |
m_parsedStyleRules(0), |
@@ -28,9 +26,9 @@ CSSLazyParsingState::CSSLazyParsingState(const CSSParserContext& context, |
} |
CSSLazyPropertyParserImpl* CSSLazyParsingState::createLazyParser( |
- const CSSParserTokenRange& block) { |
+ size_t blockOffset) { |
++m_totalStyleRules; |
- return new CSSLazyPropertyParserImpl(std::move(block), this); |
+ return new CSSLazyPropertyParserImpl(blockOffset, this); |
} |
const CSSParserContext& CSSLazyParsingState::context() { |
@@ -63,16 +61,7 @@ void CSSLazyParsingState::countRuleParsed() { |
} |
bool CSSLazyParsingState::shouldLazilyParseProperties( |
- const CSSSelectorList& selectors, |
- const CSSParserTokenRange& block) const { |
- // Simple heuristic for an empty block. Note that |block| here does not |
- // include {} brackets. We avoid lazy parsing empty blocks so we can avoid |
- // considering them when possible for matching. Lazy blocks must always be |
- // considered. Three tokens is a reasonable minimum for a block: |
- // ident ':' <value>. |
- if (block.end() - block.begin() <= 2) |
- return false; |
- |
+ const CSSSelectorList& selectors) const { |
// Disallow lazy parsing for blocks which have before/after in their selector |
// list. This ensures we don't cause a collectFeatures() when we trigger |
// parsing for attr() functions which would trigger expensive invalidation |