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

Unified Diff: Source/core/css/parser/CSSParser.cpp

Issue 962093002: CSS Tokenizer: Add an on-stack tokenizer scope (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | Source/core/css/parser/CSSParserImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSParser.cpp
diff --git a/Source/core/css/parser/CSSParser.cpp b/Source/core/css/parser/CSSParser.cpp
index a919f49b443bb7cc149217024e3d5af1571cf386..c22759619b76d40c35082838a7090e39be19bacc 100644
--- a/Source/core/css/parser/CSSParser.cpp
+++ b/Source/core/css/parser/CSSParser.cpp
@@ -34,9 +34,8 @@ bool CSSParser::parseDeclaration(MutableStylePropertySet* propertySet, const Str
void CSSParser::parseSelector(const String& selector, CSSSelectorList& selectorList)
{
if (RuntimeEnabledFeatures::newCSSParserEnabled()) {
- Vector<CSSParserToken> tokens;
- CSSTokenizer::tokenize(selector, tokens);
- CSSSelectorParser::parseSelector(tokens, m_bisonParser.m_context, starAtom, nullptr, selectorList);
+ CSSTokenizer::Scope scope(selector);
+ CSSSelectorParser::parseSelector(scope.tokenRange(), m_bisonParser.m_context, starAtom, nullptr, selectorList);
return;
}
m_bisonParser.parseSelector(selector, selectorList);
@@ -124,10 +123,9 @@ PassRefPtrWillBeRawPtr<StyleRuleKeyframe> CSSParser::parseKeyframeRule(const CSS
bool CSSParser::parseSupportsCondition(const String& condition)
{
if (RuntimeEnabledFeatures::newCSSParserEnabled()) {
- Vector<CSSParserToken> tokens;
- CSSTokenizer::tokenize(condition, tokens);
- CSSParserImpl parser(strictCSSParserContext(), "");
- return CSSSupportsParser::supportsCondition(tokens, parser) == CSSSupportsParser::Supported;
+ CSSTokenizer::Scope scope(condition);
+ CSSParserImpl parser(strictCSSParserContext());
+ return CSSSupportsParser::supportsCondition(scope.tokenRange(), parser) == CSSSupportsParser::Supported;
}
return BisonCSSParser(CSSParserContext(HTMLStandardMode, 0)).parseSupportsCondition(condition);
}
« no previous file with comments | « no previous file | Source/core/css/parser/CSSParserImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698