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

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

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Missing file :( Created 5 years, 4 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: Source/core/css/parser/CSSTokenizer.cpp
diff --git a/Source/core/css/parser/CSSTokenizer.cpp b/Source/core/css/parser/CSSTokenizer.cpp
index fcf22b22f426c1a8447cd2fea8cb62b6ef93091e..2a3a0a0a5c96d1a508adca22eda9aa9aa8e6e474 100644
--- a/Source/core/css/parser/CSSTokenizer.cpp
+++ b/Source/core/css/parser/CSSTokenizer.cpp
@@ -18,7 +18,7 @@ namespace blink {
namespace blink {
CSSTokenizer::Scope::Scope(const String& string)
-: m_string(string)
+ : m_string(string)
{
// According to the spec, we should perform preprocessing here.
// See: http://dev.w3.org/csswg/css-syntax/#input-preprocessing
@@ -48,7 +48,7 @@ CSSTokenizer::Scope::Scope(const String& string)
}
CSSTokenizer::Scope::Scope(const String& string, CSSParserObserverWrapper& wrapper)
-: m_string(string)
+ : m_string(string)
{
if (string.isEmpty())
return;
@@ -266,7 +266,7 @@ CSSParserToken CSSTokenizer::colon(UChar cc)
CSSParserToken CSSTokenizer::semiColon(UChar cc)
{
- return CSSParserToken(SemicolonToken);
+ return CSSParserToken(SemicolonToken, lastConsumedCharacter());
alancutter (OOO until 2018) 2015/08/05 08:01:43 It's not clear to me why we need to store the semi
}
CSSParserToken CSSTokenizer::hash(UChar cc)
@@ -635,11 +635,15 @@ void CSSTokenizer::consumeBadUrlRemnants()
}
}
-void CSSTokenizer::consumeUntilNonWhitespace()
+unsigned CSSTokenizer::consumeUntilNonWhitespace()
{
+ unsigned count = 0;
// Using HTML space here rather than CSS space since we don't do preprocessing
- while (isHTMLSpace<UChar>(m_input.nextInputChar()))
+ while (isHTMLSpace<UChar>(m_input.nextInputChar())) {
+ ++count;
consume();
+ }
+ return count;
}
void CSSTokenizer::consumeSingleWhitespaceIfNext()
@@ -708,6 +712,11 @@ CSSParserString CSSTokenizer::consumeName()
}
}
+CSSParserString CSSTokenizer::lastConsumedCharacter()
+{
+ return m_input.rangeAsCSSParserString(m_input.offset() - 1, 1);
+}
+
// http://dev.w3.org/csswg/css-syntax/#consume-an-escaped-code-point
UChar32 CSSTokenizer::consumeEscape()
{

Powered by Google App Engine
This is Rietveld 408576698