| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/css/parser/CSSTokenizer.h" | 6 #include "core/css/parser/CSSTokenizer.h" |
| 7 | 7 |
| 8 namespace blink { | 8 namespace blink { |
| 9 #include "core/CSSTokenizerCodepoints.cpp" | 9 #include "core/CSSTokenizerCodepoints.cpp" |
| 10 } | 10 } |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 while (consumedHexDigits < 6 && isASCIIHexDigit(m_input.nextInputChar())
) { | 722 while (consumedHexDigits < 6 && isASCIIHexDigit(m_input.nextInputChar())
) { |
| 723 cc = consume(); | 723 cc = consume(); |
| 724 hexChars.append(cc); | 724 hexChars.append(cc); |
| 725 consumedHexDigits++; | 725 consumedHexDigits++; |
| 726 }; | 726 }; |
| 727 consumeSingleWhitespaceIfNext(); | 727 consumeSingleWhitespaceIfNext(); |
| 728 bool ok = false; | 728 bool ok = false; |
| 729 UChar32 codePoint = hexChars.toString().toUIntStrict(&ok, 16); | 729 UChar32 codePoint = hexChars.toString().toUIntStrict(&ok, 16); |
| 730 ASSERT(ok); | 730 ASSERT(ok); |
| 731 if (codePoint == 0 || (0xD800 <= codePoint && codePoint <= 0xDFFF) || co
dePoint > 0x10FFFF) | 731 if (codePoint == 0 || (0xD800 <= codePoint && codePoint <= 0xDFFF) || co
dePoint > 0x10FFFF) |
| 732 return WTF::Unicode::replacementCharacter; | 732 return replacementCharacter; |
| 733 return codePoint; | 733 return codePoint; |
| 734 } | 734 } |
| 735 | 735 |
| 736 if (cc == kEndOfFileMarker) | 736 if (cc == kEndOfFileMarker) |
| 737 return WTF::Unicode::replacementCharacter; | 737 return replacementCharacter; |
| 738 return cc; | 738 return cc; |
| 739 } | 739 } |
| 740 | 740 |
| 741 bool CSSTokenizer::nextTwoCharsAreValidEscape() | 741 bool CSSTokenizer::nextTwoCharsAreValidEscape() |
| 742 { | 742 { |
| 743 return twoCharsAreValidEscape(m_input.nextInputChar(), m_input.peek(1)); | 743 return twoCharsAreValidEscape(m_input.nextInputChar(), m_input.peek(1)); |
| 744 } | 744 } |
| 745 | 745 |
| 746 // http://www.w3.org/TR/css3-syntax/#starts-with-a-number | 746 // http://www.w3.org/TR/css3-syntax/#starts-with-a-number |
| 747 bool CSSTokenizer::nextCharsAreNumber(UChar first) | 747 bool CSSTokenizer::nextCharsAreNumber(UChar first) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 | 787 |
| 788 CSSParserString CSSTokenizer::registerString(const String& string) | 788 CSSParserString CSSTokenizer::registerString(const String& string) |
| 789 { | 789 { |
| 790 m_scope.storeString(string); | 790 m_scope.storeString(string); |
| 791 CSSParserString result; | 791 CSSParserString result; |
| 792 result.init(string); | 792 result.init(string); |
| 793 return result; | 793 return result; |
| 794 } | 794 } |
| 795 | 795 |
| 796 } // namespace blink | 796 } // namespace blink |
| OLD | NEW |