| Index: Source/core/css/parser/MediaQueryTokenizer.cpp
|
| diff --git a/Source/core/css/parser/MediaQueryTokenizer.cpp b/Source/core/css/parser/MediaQueryTokenizer.cpp
|
| index fb3a61e229ca278e8b7d98cb60cdc9314827780f..ead42f1b28dccc99c18c871a827e71167994c05e 100644
|
| --- a/Source/core/css/parser/MediaQueryTokenizer.cpp
|
| +++ b/Source/core/css/parser/MediaQueryTokenizer.cpp
|
| @@ -5,54 +5,16 @@
|
| #include "config.h"
|
| #include "core/css/parser/MediaQueryTokenizer.h"
|
|
|
| +namespace WebCore {
|
| +#include "MediaQueryTokenizerCodepoints.cpp"
|
| +}
|
| +
|
| #include "core/css/parser/MediaQueryInputStream.h"
|
| #include "core/html/parser/HTMLParserIdioms.h"
|
| #include "wtf/unicode/CharacterNames.h"
|
|
|
| namespace WebCore {
|
|
|
| -const unsigned codePointsNumber = SCHAR_MAX + 1;
|
| -
|
| -class MediaQueryTokenizer::CodePoints {
|
| -public:
|
| - MediaQueryTokenizer::CodePoint codePoints[codePointsNumber];
|
| -
|
| - // FIXME: Move the codePoint array to be a static one, generated by build scripts
|
| - CodePoints()
|
| - {
|
| - memset(codePoints, 0, codePointsNumber);
|
| - codePoints['\n'] = &MediaQueryTokenizer::whiteSpace;
|
| - codePoints['\r'] = &MediaQueryTokenizer::whiteSpace;
|
| - codePoints['\t'] = &MediaQueryTokenizer::whiteSpace;
|
| - codePoints[' '] = &MediaQueryTokenizer::whiteSpace;
|
| - codePoints['\f'] = &MediaQueryTokenizer::whiteSpace;
|
| - codePoints['('] = &MediaQueryTokenizer::leftParenthesis;
|
| - codePoints[')'] = &MediaQueryTokenizer::rightParenthesis;
|
| - codePoints['+'] = &MediaQueryTokenizer::plusOrFullStop;
|
| - codePoints['.'] = &MediaQueryTokenizer::plusOrFullStop;
|
| - codePoints[','] = &MediaQueryTokenizer::comma;
|
| - codePoints['-'] = &MediaQueryTokenizer::hyphenMinus;
|
| - codePoints['/'] = &MediaQueryTokenizer::solidus;
|
| - codePoints[':'] = &MediaQueryTokenizer::colon;
|
| - codePoints[';'] = &MediaQueryTokenizer::semiColon;
|
| - codePoints['\\'] = &MediaQueryTokenizer::reverseSolidus;
|
| - for (unsigned char digit = '0'; digit <= '9'; ++digit)
|
| - codePoints[digit] = &MediaQueryTokenizer::asciiDigit;
|
| - for (unsigned char alpha = 'a'; alpha <= 'z'; ++alpha)
|
| - codePoints[alpha] = &MediaQueryTokenizer::nameStart;
|
| - for (unsigned char alpha = 'A'; alpha <= 'Z'; ++alpha)
|
| - codePoints[alpha] = &MediaQueryTokenizer::nameStart;
|
| - codePoints['_'] = &MediaQueryTokenizer::nameStart;
|
| - codePoints[kEndOfFileMarker] = &MediaQueryTokenizer::endOfFile;
|
| - }
|
| -};
|
| -
|
| -MediaQueryTokenizer::CodePoints* MediaQueryTokenizer::codePoints()
|
| -{
|
| - static CodePoints codePoints;
|
| - return &codePoints;
|
| -}
|
| -
|
| // http://dev.w3.org/csswg/css-syntax/#name-start-code-point
|
| static bool isNameStart(UChar c)
|
| {
|
| @@ -216,7 +178,7 @@ MediaQueryToken MediaQueryTokenizer::nextToken()
|
|
|
| if (isASCII(cc)) {
|
| ASSERT_WITH_SECURITY_IMPLICATION(cc < codePointsNumber);
|
| - codePointFunc = codePoints()->codePoints[cc];
|
| + codePointFunc = codePoints[cc];
|
| } else {
|
| codePointFunc = &MediaQueryTokenizer::nameStart;
|
| }
|
|
|