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

Side by Side Diff: Source/core/css/parser/CSSTokenizer.h

Issue 962093002: CSS Tokenizer: Add an on-stack tokenizer scope (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 #ifndef CSSTokenizer_h 5 #ifndef CSSTokenizer_h
6 #define CSSTokenizer_h 6 #define CSSTokenizer_h
7 7
8 #include "core/css/parser/CSSParserToken.h" 8 #include "core/css/parser/CSSParserToken.h"
9 #include "core/html/parser/InputStreamPreprocessor.h" 9 #include "core/html/parser/InputStreamPreprocessor.h"
10 #include "wtf/text/WTFString.h" 10 #include "wtf/text/WTFString.h"
11 11
12 #include <climits> 12 #include <climits>
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class CSSTokenizerInputStream; 16 class CSSTokenizerInputStream;
17 class CSSParserTokenRange;
17 18
18 class CSSTokenizer { 19 class CSSTokenizer {
19 WTF_MAKE_NONCOPYABLE(CSSTokenizer); 20 WTF_MAKE_NONCOPYABLE(CSSTokenizer);
20 WTF_MAKE_FAST_ALLOCATED; 21 WTF_MAKE_FAST_ALLOCATED;
21 public: 22 public:
22 static void tokenize(String, Vector<CSSParserToken>&); 23 class Scope {
24 public:
25 Scope(const String&);
26 CSSParserTokenRange tokenRange();
27
28 private:
29 Vector<CSSParserToken> m_tokens;
30 };
31
23 private: 32 private:
24 CSSTokenizer(CSSTokenizerInputStream&); 33 CSSTokenizer(CSSTokenizerInputStream&);
25 34
26 CSSParserToken nextToken(); 35 CSSParserToken nextToken();
27 36
28 UChar consume(); 37 UChar consume();
29 void consume(unsigned); 38 void consume(unsigned);
30 void reconsume(UChar); 39 void reconsume(UChar);
31 40
32 CSSParserToken consumeNumericToken(); 41 CSSParserToken consumeNumericToken();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 CSSParserToken endOfFile(UChar); 97 CSSParserToken endOfFile(UChar);
89 98
90 CSSTokenizerInputStream& m_input; 99 CSSTokenizerInputStream& m_input;
91 }; 100 };
92 101
93 102
94 103
95 } // namespace blink 104 } // namespace blink
96 105
97 #endif // CSSTokenizer_h 106 #endif // CSSTokenizer_h
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSSelectorParserTest.cpp ('k') | Source/core/css/parser/CSSTokenizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698