Chromium Code Reviews| 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 |
| 11 namespace WebCore { | 11 namespace WebCore { |
| 12 | 12 |
| 13 enum MediaQueryTokenType { | 13 enum MediaQueryTokenType { |
| 14 IdentToken = 0, | 14 IdentToken = 0, |
| 15 FunctionToken = 1, | 15 FunctionToken, |
| 16 DelimiterToken = 2, | 16 DelimiterToken, |
| 17 NumberToken = 3, | 17 NumberToken, |
| 18 PercentageToken = 4, | 18 PercentageToken, |
| 19 DimensionToken = 5, | 19 DimensionToken, |
| 20 WhitespaceToken = 6, | 20 WhitespaceToken, |
| 21 ColonToken = 7, | 21 ColonToken, |
| 22 SemicolonToken = 8, | 22 SemicolonToken, |
| 23 CommaToken = 9, | 23 CommaToken, |
| 24 LeftParenthesisToken = 10, | 24 LeftParenthesisToken, |
| 25 RightParenthesisToken = 11, | 25 RightParenthesisToken, |
| 26 LeftBracketToken = 12, | 26 LeftBracketToken, |
| 27 RightBracketToken = 13, | 27 RightBracketToken, |
| 28 LeftBraceToken = 14, | 28 LeftBraceToken, |
| 29 RightBraceToken = 15, | 29 RightBraceToken, |
| 30 StringToken = 15, | 30 StringToken, |
| 31 BadStringToken = 16, | 31 BadStringToken, |
| 32 EOFToken = 17, | 32 EOFToken, |
| 33 CommentToken = 18, | 33 CommentToken, |
| 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 BlockType { | 43 enum BlockType { |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 59 void convertToPercentage(); | 59 void convertToPercentage(); |
| 60 | 60 |
| 61 MediaQueryTokenType type() const { return m_type; } | 61 MediaQueryTokenType type() const { return m_type; } |
| 62 String value() const { return m_value; } | 62 String value() const { return m_value; } |
| 63 String textForUnitTests() const; | 63 String textForUnitTests() const; |
| 64 | 64 |
| 65 UChar delimiter() const { return m_delimiter; } | 65 UChar delimiter() const { return m_delimiter; } |
| 66 NumericValueType numericValueType() const { return m_numericValueType; } | 66 NumericValueType numericValueType() const { return m_numericValueType; } |
| 67 double numericValue() const { return m_numericValue; } | 67 double numericValue() const { return m_numericValue; } |
| 68 CSSPrimitiveValue::UnitTypes unitType() const { return m_unit; } | 68 CSSPrimitiveValue::UnitTypes unitType() const { return m_unit; } |
| 69 BlockType blockType() const { return m_blockType; } | 69 BlockType blockType() const { return m_blockType; } |
|
alancutter (OOO until 2018)
2014/04/30 04:02:17
It concerns me that none of these getters have ASS
| |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 MediaQueryTokenType m_type; | 72 MediaQueryTokenType m_type; |
| 73 String m_value; | 73 String m_value; |
| 74 | 74 |
| 75 UChar m_delimiter; // Could be rolled into m_value? | 75 UChar m_delimiter; // Could be rolled into m_value? |
| 76 | 76 |
| 77 NumericValueType m_numericValueType; | 77 NumericValueType m_numericValueType; |
| 78 double m_numericValue; | 78 double m_numericValue; |
| 79 CSSPrimitiveValue::UnitTypes m_unit; | 79 CSSPrimitiveValue::UnitTypes m_unit; |
| 80 | 80 |
| 81 BlockType m_blockType; | 81 BlockType m_blockType; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 typedef Vector<MediaQueryToken>::iterator MediaQueryTokenIterator; | |
| 85 | |
| 84 } // namespace | 86 } // namespace |
| 85 | 87 |
| 86 #endif // MediaQueryToken_h | 88 #endif // MediaQueryToken_h |
| OLD | NEW |