OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |