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 #ifndef MediaQueryToken_h | 5 #ifndef MediaQueryToken_h |
6 #define MediaQueryToken_h | 6 #define MediaQueryToken_h |
7 | 7 |
8 #include "core/css/CSSPrimitiveValue.h" | 8 #include "core/css/CSSPrimitiveValue.h" |
9 #include "wtf/text/WTFString.h" | 9 #include "wtf/text/WTFString.h" |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... | |
33 CommentToken = 18, | 33 CommentToken = 18, |
34 }; | 34 }; |
35 | 35 |
36 enum NumericValueType { | 36 enum NumericValueType { |
37 IntegerValueType, | 37 IntegerValueType, |
38 NumberValueType, | 38 NumberValueType, |
39 }; | 39 }; |
40 | 40 |
41 class MediaQueryToken { | 41 class MediaQueryToken { |
42 public: | 42 public: |
43 enum BlockToken { | |
eseidel
2014/04/08 16:58:49
Maybe BlockType? BlockToken makes me think this i
| |
44 NotBlockToken, | |
45 BlockStart, | |
46 BlockEnd, | |
47 }; | |
48 | |
43 MediaQueryToken(MediaQueryTokenType); | 49 MediaQueryToken(MediaQueryTokenType); |
50 MediaQueryToken(MediaQueryTokenType, BlockToken); | |
44 MediaQueryToken(MediaQueryTokenType, String); | 51 MediaQueryToken(MediaQueryTokenType, String); |
52 MediaQueryToken(MediaQueryTokenType, String, BlockToken); | |
eseidel
2014/04/08 16:58:49
What does this String do?
| |
45 | 53 |
46 MediaQueryToken(MediaQueryTokenType, UChar); // for DelimiterToken | 54 MediaQueryToken(MediaQueryTokenType, UChar); // for DelimiterToken |
47 MediaQueryToken(MediaQueryTokenType, double, NumericValueType); // for Numbe rToken | 55 MediaQueryToken(MediaQueryTokenType, double, NumericValueType); // for Numbe rToken |
48 | 56 |
49 // Converts NumberToken to DimensionToken. | 57 // Converts NumberToken to DimensionToken. |
50 void convertToDimensionWithUnit(String); | 58 void convertToDimensionWithUnit(String); |
51 | 59 |
52 // Converts NumberToken to PercentageToken. | 60 // Converts NumberToken to PercentageToken. |
53 void convertToPercentage(); | 61 void convertToPercentage(); |
54 | 62 |
55 MediaQueryTokenType type() const { return m_type; } | 63 MediaQueryTokenType type() const { return m_type; } |
56 String value() const { return m_value; } | 64 String value() const { return m_value; } |
57 String textForUnitTests() const; | 65 String textForUnitTests() const; |
58 | 66 |
59 UChar delimiter() const { return m_delimiter; } | 67 UChar delimiter() const { return m_delimiter; } |
60 NumericValueType numericValueType() const { return m_numericValueType; } | 68 NumericValueType numericValueType() const { return m_numericValueType; } |
61 double numericValue() const { return m_numericValue; } | 69 double numericValue() const { return m_numericValue; } |
62 CSSPrimitiveValue::UnitTypes unitType() const { return m_unit; } | 70 CSSPrimitiveValue::UnitTypes unitType() const { return m_unit; } |
71 BlockToken blockToken() const { return m_blockToken; } | |
63 | 72 |
64 private: | 73 private: |
65 MediaQueryTokenType m_type; | 74 MediaQueryTokenType m_type; |
66 String m_value; | 75 String m_value; |
67 | 76 |
68 UChar m_delimiter; // Could be rolled into m_value? | 77 UChar m_delimiter; // Could be rolled into m_value? |
69 | 78 |
70 NumericValueType m_numericValueType; | 79 NumericValueType m_numericValueType; |
71 double m_numericValue; | 80 double m_numericValue; |
72 CSSPrimitiveValue::UnitTypes m_unit; | 81 CSSPrimitiveValue::UnitTypes m_unit; |
82 | |
83 BlockToken m_blockToken; | |
73 }; | 84 }; |
74 | 85 |
75 } | 86 } |
76 | 87 |
77 #endif // MediaQueryToken_h | 88 #endif // MediaQueryToken_h |
OLD | NEW |