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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp

Issue 1636453002: Use ASCII case-insensitive matching for ident-likes in the CSS parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Consistent indentation in test. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/parser/CSSTokenizer.h" 5 #include "core/css/parser/CSSTokenizer.h"
6 6
7 namespace blink { 7 namespace blink {
8 #include "core/CSSTokenizerCodepoints.cpp" 8 #include "core/CSSTokenizerCodepoints.cpp"
9 } 9 }
10 10
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 else if (consumeIfNext('%')) 476 else if (consumeIfNext('%'))
477 token.convertToPercentage(); 477 token.convertToPercentage();
478 return token; 478 return token;
479 } 479 }
480 480
481 // http://dev.w3.org/csswg/css-syntax/#consume-ident-like-token 481 // http://dev.w3.org/csswg/css-syntax/#consume-ident-like-token
482 CSSParserToken CSSTokenizer::consumeIdentLikeToken() 482 CSSParserToken CSSTokenizer::consumeIdentLikeToken()
483 { 483 {
484 CSSParserString name = consumeName(); 484 CSSParserString name = consumeName();
485 if (consumeIfNext('(')) { 485 if (consumeIfNext('(')) {
486 if (name.equalIgnoringCase("url")) { 486 if (name.equalIgnoringASCIICase("url")) {
487 // The spec is slightly different so as to avoid dropping whitespace 487 // The spec is slightly different so as to avoid dropping whitespace
488 // tokens, but they wouldn't be used and this is easier. 488 // tokens, but they wouldn't be used and this is easier.
489 consumeUntilNonWhitespace(); 489 consumeUntilNonWhitespace();
490 UChar next = m_input.nextInputChar(); 490 UChar next = m_input.nextInputChar();
491 if (next != '"' && next != '\'') 491 if (next != '"' && next != '\'')
492 return consumeUrlToken(); 492 return consumeUrlToken();
493 } 493 }
494 return blockStart(LeftParenthesisToken, FunctionToken, name); 494 return blockStart(LeftParenthesisToken, FunctionToken, name);
495 } 495 }
496 return CSSParserToken(IdentToken, name); 496 return CSSParserToken(IdentToken, name);
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 784
785 CSSParserString CSSTokenizer::registerString(const String& string) 785 CSSParserString CSSTokenizer::registerString(const String& string)
786 { 786 {
787 m_scope.storeString(string); 787 m_scope.storeString(string);
788 CSSParserString result; 788 CSSParserString result;
789 result.init(string); 789 result.init(string);
790 return result; 790 return result;
791 } 791 }
792 792
793 } // namespace blink 793 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698