OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CSSSyntaxDescriptor_h | 5 #ifndef CSSSyntaxDescriptor_h |
6 #define CSSSyntaxDescriptor_h | 6 #define CSSSyntaxDescriptor_h |
7 | 7 |
8 #include "core/css/parser/CSSParserTokenRange.h" | 8 #include "core/css/parser/CSSParserTokenRange.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class CSSParserContext; | 12 class CSSParserContext; |
13 class CSSValue; | 13 class CSSValue; |
14 | 14 |
15 enum class CSSSyntaxType { | 15 enum class CSSSyntaxType { |
16 kTokenStream, | 16 kTokenStream, |
17 kIdent, | 17 kIdent, |
18 kLength, | 18 kLength, |
19 kNumber, | 19 kNumber, |
20 kPercentage, | 20 kPercentage, |
21 kLengthPercentage, | 21 kLengthPercentage, |
22 kColor, | 22 kColor, |
23 kImage, | 23 kImage, |
24 kUrl, | 24 kUrl, |
25 kInteger, | 25 kInteger, |
26 kAngle, | 26 kAngle, |
27 kTime, | 27 kTime, |
28 kResolution, | 28 kResolution, |
29 kTransformFunction, | 29 kTransformList, |
30 kCustomIdent, | 30 kCustomIdent, |
31 }; | 31 }; |
32 | 32 |
33 struct CSSSyntaxComponent { | 33 struct CSSSyntaxComponent { |
34 CSSSyntaxComponent(CSSSyntaxType type, const String& string, bool repeatable) | 34 CSSSyntaxComponent(CSSSyntaxType type, const String& string, bool repeatable) |
35 : type_(type), string_(string), repeatable_(repeatable) {} | 35 : type_(type), string_(string), repeatable_(repeatable) {} |
36 | 36 |
37 CSSSyntaxType type_; | 37 CSSSyntaxType type_; |
38 String string_; // Only used when type_ is CSSSyntaxType::kIdent | 38 String string_; // Only used when type_ is CSSSyntaxType::kIdent |
39 bool repeatable_; | 39 bool repeatable_; |
(...skipping 15 matching lines...) Expand all Loading... |
55 return syntax_components_; | 55 return syntax_components_; |
56 } | 56 } |
57 | 57 |
58 private: | 58 private: |
59 Vector<CSSSyntaxComponent> syntax_components_; | 59 Vector<CSSSyntaxComponent> syntax_components_; |
60 }; | 60 }; |
61 | 61 |
62 } // namespace blink | 62 } // namespace blink |
63 | 63 |
64 #endif // CSSSyntaxDescriptor_h | 64 #endif // CSSSyntaxDescriptor_h |
OLD | NEW |