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 "config.h" | 5 #include "config.h" |
6 #include "core/css/parser/CSSParserToken.h" | 6 #include "core/css/parser/CSSParserToken.h" |
7 | 7 |
8 #include "wtf/HashMap.h" | 8 #include "wtf/HashMap.h" |
9 #include "wtf/text/StringHash.h" | 9 #include "wtf/text/StringHash.h" |
10 #include <limits.h> | 10 #include <limits.h> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 , m_numericValueType(numericValueType) | 48 , m_numericValueType(numericValueType) |
49 , m_numericValue(numericValue) | 49 , m_numericValue(numericValue) |
50 , m_unit(CSSPrimitiveValue::CSS_NUMBER) | 50 , m_unit(CSSPrimitiveValue::CSS_NUMBER) |
51 , m_blockType(NotBlock) | 51 , m_blockType(NotBlock) |
52 { | 52 { |
53 ASSERT(type == NumberToken); | 53 ASSERT(type == NumberToken); |
54 } | 54 } |
55 | 55 |
56 CSSParserToken::CSSParserToken(CSSParserTokenType type, UChar32 start, UChar32 e
nd) | 56 CSSParserToken::CSSParserToken(CSSParserTokenType type, UChar32 start, UChar32 e
nd) |
57 : m_type(UnicodeRangeToken) | 57 : m_type(UnicodeRangeToken) |
| 58 , m_value(String::format("U+%X-%X", start, end)) // FIXME: Remove this once
CSSParserValues is gone |
58 , m_delimiter(0) | 59 , m_delimiter(0) |
59 , m_numericValue(0) | 60 , m_numericValue(0) |
60 , m_unit(CSSPrimitiveValue::CSS_UNKNOWN) | 61 , m_unit(CSSPrimitiveValue::CSS_UNKNOWN) |
61 , m_unicodeRangeStart(start) | 62 , m_unicodeRangeStart(start) |
62 , m_unicodeRangeEnd(end) | 63 , m_unicodeRangeEnd(end) |
63 , m_blockType(NotBlock) | 64 , m_blockType(NotBlock) |
64 { | 65 { |
65 ASSERT_UNUSED(type, type == UnicodeRangeToken); | 66 ASSERT_UNUSED(type, type == UnicodeRangeToken); |
66 } | 67 } |
67 | 68 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 return m_numericValueType; | 103 return m_numericValueType; |
103 } | 104 } |
104 | 105 |
105 double CSSParserToken::numericValue() const | 106 double CSSParserToken::numericValue() const |
106 { | 107 { |
107 ASSERT(m_type == NumberToken || m_type == PercentageToken || m_type == Dimen
sionToken); | 108 ASSERT(m_type == NumberToken || m_type == PercentageToken || m_type == Dimen
sionToken); |
108 return m_numericValue; | 109 return m_numericValue; |
109 } | 110 } |
110 | 111 |
111 } // namespace blink | 112 } // namespace blink |
OLD | NEW |