Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: Source/core/css/parser/MediaQueryTokenizer.cpp

Issue 203343004: Fixed an assert related to MediaQuerytokenizer code points table (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added test Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/parser/MediaQueryTokenizerTest.cpp » ('j') | Source/core/css/parser/MediaQueryTokenizerTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698