| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // We could move to the stateful model and instead create | 302 // We could move to the stateful model and instead create |
| 303 // states for all the "next 3 codepoints are X" cases. | 303 // states for all the "next 3 codepoints are X" cases. |
| 304 // State-machine tokenizers are easier to write to handle | 304 // State-machine tokenizers are easier to write to handle |
| 305 // incremental tokenization of partial sources. | 305 // incremental tokenization of partial sources. |
| 306 // However, for now we follow the spec exactly. | 306 // However, for now we follow the spec exactly. |
| 307 UChar cc = consume(); | 307 UChar cc = consume(); |
| 308 CodePoint codePointFunc = 0; | 308 CodePoint codePointFunc = 0; |
| 309 | 309 |
| 310 if (isASCII(cc)) { | 310 if (isASCII(cc)) { |
| 311 SECURITY_DCHECK(cc < codePointsNumber); | 311 SECURITY_DCHECK(cc < codePointsNumber); |
| 312 codePointFunc = codePoints[cc]; | 312 code_point_func = kCodePoints[cc]; |
| 313 } else { | 313 } else { |
| 314 codePointFunc = &CSSTokenizer::nameStart; | 314 codePointFunc = &CSSTokenizer::nameStart; |
| 315 } | 315 } |
| 316 | 316 |
| 317 if (codePointFunc) | 317 if (codePointFunc) |
| 318 return ((this)->*(codePointFunc))(cc); | 318 return ((this)->*(codePointFunc))(cc); |
| 319 return CSSParserToken(DelimiterToken, cc); | 319 return CSSParserToken(DelimiterToken, cc); |
| 320 } | 320 } |
| 321 | 321 |
| 322 // This method merges the following spec sections for efficiency | 322 // This method merges the following spec sections for efficiency |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 reconsume(first); | 675 reconsume(first); |
| 676 return areIdentifier; | 676 return areIdentifier; |
| 677 } | 677 } |
| 678 | 678 |
| 679 StringView CSSTokenizer::registerString(const String& string) { | 679 StringView CSSTokenizer::registerString(const String& string) { |
| 680 m_stringPool.push_back(string); | 680 m_stringPool.push_back(string); |
| 681 return string; | 681 return string; |
| 682 } | 682 } |
| 683 | 683 |
| 684 } // namespace blink | 684 } // namespace blink |
| OLD | NEW |