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

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: ToTed 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..ec99274e8586e1c01b88a6fecc3dc34c2272d66e 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;
@@ -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