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

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

Issue 649493003: CSS Tokenizer: Consume a single whitespace after escapes if present (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@getfraction
Patch Set: update tests Created 6 years, 2 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/CSSTokenizer.h ('k') | Source/core/css/parser/CSSTokenizerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSTokenizer.cpp
diff --git a/Source/core/css/parser/CSSTokenizer.cpp b/Source/core/css/parser/CSSTokenizer.cpp
index 069150f6ca923cae3c797c76a59694211a93a0e6..443577c3764bbfd9491f596d797cb215d9182ac8 100644
--- a/Source/core/css/parser/CSSTokenizer.cpp
+++ b/Source/core/css/parser/CSSTokenizer.cpp
@@ -395,6 +395,16 @@ void CSSTokenizer::consumeUntilNonWhitespace()
consume();
}
+void CSSTokenizer::consumeSingleWhitespaceIfNext()
+{
+ // We check for \r\n and HTML spaces since we don't do preprocessing
+ UChar c = m_input.nextInputChar();
+ if (c == '\r' && m_input.peek(1) == '\n')
+ consume(2);
+ else if (isHTMLSpace(c))
+ consume();
+}
+
bool CSSTokenizer::consumeUntilCommentEndFound()
{
UChar c = consume();
@@ -456,6 +466,7 @@ UChar CSSTokenizer::consumeEscape()
hexChars.append(cc);
consumedHexDigits++;
};
+ consumeSingleWhitespaceIfNext();
bool ok = false;
UChar codePoint = hexChars.toString().toUIntStrict(&ok, 16);
if (!ok)
« no previous file with comments | « Source/core/css/parser/CSSTokenizer.h ('k') | Source/core/css/parser/CSSTokenizerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698