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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 CSSParserToken CSSTokenizer::blockStart(CSSParserTokenType blockType, | 117 CSSParserToken CSSTokenizer::blockStart(CSSParserTokenType blockType, |
118 CSSParserTokenType type, | 118 CSSParserTokenType type, |
119 StringView name) { | 119 StringView name) { |
120 m_blockStack.append(blockType); | 120 m_blockStack.append(blockType); |
121 return CSSParserToken(type, name, CSSParserToken::BlockStart); | 121 return CSSParserToken(type, name, CSSParserToken::BlockStart); |
122 } | 122 } |
123 | 123 |
124 CSSParserToken CSSTokenizer::blockEnd(CSSParserTokenType type, | 124 CSSParserToken CSSTokenizer::blockEnd(CSSParserTokenType type, |
125 CSSParserTokenType startType) { | 125 CSSParserTokenType startType) { |
126 if (!m_blockStack.isEmpty() && m_blockStack.last() == startType) { | 126 if (!m_blockStack.isEmpty() && m_blockStack.last() == startType) { |
127 m_blockStack.removeLast(); | 127 m_blockStack.pop_back(); |
128 return CSSParserToken(type, CSSParserToken::BlockEnd); | 128 return CSSParserToken(type, CSSParserToken::BlockEnd); |
129 } | 129 } |
130 return CSSParserToken(type); | 130 return CSSParserToken(type); |
131 } | 131 } |
132 | 132 |
133 CSSParserToken CSSTokenizer::leftParenthesis(UChar cc) { | 133 CSSParserToken CSSTokenizer::leftParenthesis(UChar cc) { |
134 return blockStart(LeftParenthesisToken); | 134 return blockStart(LeftParenthesisToken); |
135 } | 135 } |
136 | 136 |
137 CSSParserToken CSSTokenizer::rightParenthesis(UChar cc) { | 137 CSSParserToken CSSTokenizer::rightParenthesis(UChar cc) { |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 reconsume(first); | 684 reconsume(first); |
685 return areIdentifier; | 685 return areIdentifier; |
686 } | 686 } |
687 | 687 |
688 StringView CSSTokenizer::registerString(const String& string) { | 688 StringView CSSTokenizer::registerString(const String& string) { |
689 m_scope.storeString(string); | 689 m_scope.storeString(string); |
690 return string; | 690 return string; |
691 } | 691 } |
692 | 692 |
693 } // namespace blink | 693 } // namespace blink |
OLD | NEW |