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

Unified Diff: Source/core/css/parser/SizesAttributeParser.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 | « Source/core/css/parser/SizesAttributeParser.h ('k') | Source/core/css/parser/SizesCalcParserTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/SizesAttributeParser.cpp
diff --git a/Source/core/css/parser/SizesAttributeParser.cpp b/Source/core/css/parser/SizesAttributeParser.cpp
index 68f601f2c52ae9160ab68f8c7315352b03afef7b..24881769af18ed9e61e853cd5e9d508a84f387b4 100644
--- a/Source/core/css/parser/SizesAttributeParser.cpp
+++ b/Source/core/css/parser/SizesAttributeParser.cpp
@@ -17,8 +17,7 @@ SizesAttributeParser::SizesAttributeParser(PassRefPtr<MediaValues> mediaValues,
, m_length(0)
, m_lengthWasSet(false)
{
- CSSTokenizer::tokenize(attribute, m_tokens);
- m_isValid = parse(m_tokens);
+ m_isValid = parse(CSSTokenizer::Scope(attribute).tokenRange());
}
float SizesAttributeParser::length()
@@ -61,9 +60,8 @@ bool SizesAttributeParser::mediaConditionMatches(PassRefPtrWillBeRawPtr<MediaQue
return mediaQueryEvaluator.eval(mediaCondition.get());
}
-bool SizesAttributeParser::parse(Vector<CSSParserToken>& tokens)
+bool SizesAttributeParser::parse(CSSParserTokenRange range)
{
- CSSParserTokenRange range(tokens);
// Split on a comma token and parse the result tokens as (media-condition, length) pairs
while (!range.atEnd()) {
const CSSParserToken* mediaConditionStart = &range.peek();
« no previous file with comments | « Source/core/css/parser/SizesAttributeParser.h ('k') | Source/core/css/parser/SizesCalcParserTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698