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

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

Issue 825063004: CSS Parser: Support CDO and CDC tokens (<!--, -->) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@lang
Patch Set: Created 5 years, 11 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 a36a047b5e051c69a379220dfbf17086faf9d0db..2245ffe677efda98864da882d71118d6a7568e20 100644
--- a/Source/core/css/parser/CSSTokenizer.cpp
+++ b/Source/core/css/parser/CSSTokenizer.cpp
@@ -148,6 +148,16 @@ CSSParserToken CSSTokenizer::asterisk(UChar cc)
return CSSParserToken(DelimiterToken, '*');
}
+CSSParserToken CSSTokenizer::lessThan(UChar cc)
+{
+ ASSERT(cc == '<');
+ if (m_input.peek(0) == '!' && m_input.peek(1) == '-' && m_input.peek(2) == '-') {
+ consume(3);
+ return CSSParserToken(CDOToken);
+ }
+ return CSSParserToken(DelimiterToken, '<');
+}
+
CSSParserToken CSSTokenizer::comma(UChar cc)
{
return CSSParserToken(CommaToken);
@@ -159,6 +169,10 @@ CSSParserToken CSSTokenizer::hyphenMinus(UChar cc)
reconsume(cc);
return consumeNumericToken();
}
+ if (m_input.peek(0) == '-' && m_input.peek(1) == '>') {
+ consume(2);
+ return CSSParserToken(CDCToken);
+ }
if (nextCharsAreIdentifier(cc)) {
reconsume(cc);
return consumeIdentLikeToken();
« 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