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/MediaQueryTokenizer.h" | 6 #include "core/css/parser/MediaQueryTokenizer.h" |
7 | 7 |
8 #include "core/css/parser/MediaQueryInputStream.h" | 8 #include "core/css/parser/MediaQueryInputStream.h" |
9 #include "core/html/parser/HTMLParserIdioms.h" | 9 #include "core/html/parser/HTMLParserIdioms.h" |
10 #include "wtf/unicode/CharacterNames.h" | 10 #include "wtf/unicode/CharacterNames.h" |
11 | 11 |
12 namespace WebCore { | 12 namespace WebCore { |
13 | 13 |
14 const unsigned codePointsNumber = SCHAR_MAX; | 14 const unsigned codePointsNumber = SCHAR_MAX + 1; |
15 | 15 |
16 class MediaQueryTokenizer::CodePoints { | 16 class MediaQueryTokenizer::CodePoints { |
17 public: | 17 public: |
18 MediaQueryTokenizer::CodePoint codePoints[codePointsNumber]; | 18 MediaQueryTokenizer::CodePoint codePoints[codePointsNumber]; |
19 | 19 |
20 // FIXME: Move the codePoint array to be a static one, generated by build sc
ripts | 20 // FIXME: Move the codePoint array to be a static one, generated by build sc
ripts |
21 CodePoints() | 21 CodePoints() |
22 { | 22 { |
23 memset(codePoints, 0, codePointsNumber); | 23 memset(codePoints, 0, codePointsNumber); |
24 codePoints['\n'] = &MediaQueryTokenizer::whiteSpace; | 24 codePoints['\n'] = &MediaQueryTokenizer::whiteSpace; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 if (firstChar == '-') { | 422 if (firstChar == '-') { |
423 if (isNameStart(m_input.peek(1))) | 423 if (isNameStart(m_input.peek(1))) |
424 return true; | 424 return true; |
425 return nextTwoCharsAreValidEscape(); | 425 return nextTwoCharsAreValidEscape(); |
426 } | 426 } |
427 | 427 |
428 return false; | 428 return false; |
429 } | 429 } |
430 | 430 |
431 } // namespace WebCore | 431 } // namespace WebCore |
OLD | NEW |