| 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 CSSParserToken_h | 5 #ifndef CSSParserToken_h |
| 6 #define CSSParserToken_h | 6 #define CSSParserToken_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/css/CSSPrimitiveValue.h" | 9 #include "core/css/CSSPrimitiveValue.h" |
| 10 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 // Converts NumberToken to DimensionToken. | 88 // Converts NumberToken to DimensionToken. |
| 89 void convertToDimensionWithUnit(StringView); | 89 void convertToDimensionWithUnit(StringView); |
| 90 | 90 |
| 91 // Converts NumberToken to PercentageToken. | 91 // Converts NumberToken to PercentageToken. |
| 92 void convertToPercentage(); | 92 void convertToPercentage(); |
| 93 | 93 |
| 94 CSSParserTokenType type() const { return static_cast<CSSParserTokenType>(m_t
ype); } | 94 CSSParserTokenType type() const { return static_cast<CSSParserTokenType>(m_t
ype); } |
| 95 StringView value() const | 95 StringView value() const |
| 96 { | 96 { |
| 97 return StringView(m_valueDataCharRaw, m_valueLength, m_valueIs8Bit); | 97 if (m_valueIs8Bit) |
| 98 return StringView(reinterpret_cast<const LChar*>(m_valueDataCharRaw)
, m_valueLength); |
| 99 return StringView(reinterpret_cast<const UChar*>(m_valueDataCharRaw), m_
valueLength); |
| 98 } | 100 } |
| 99 | 101 |
| 100 UChar delimiter() const; | 102 UChar delimiter() const; |
| 101 NumericSign numericSign() const; | 103 NumericSign numericSign() const; |
| 102 NumericValueType numericValueType() const; | 104 NumericValueType numericValueType() const; |
| 103 double numericValue() const; | 105 double numericValue() const; |
| 104 HashTokenType getHashTokenType() const { ASSERT(m_type == HashToken); return
m_hashTokenType; } | 106 HashTokenType getHashTokenType() const { ASSERT(m_type == HashToken); return
m_hashTokenType; } |
| 105 BlockType getBlockType() const { return static_cast<BlockType>(m_blockType);
} | 107 BlockType getBlockType() const { return static_cast<BlockType>(m_blockType);
} |
| 106 CSSPrimitiveValue::UnitType unitType() const { return static_cast<CSSPrimiti
veValue::UnitType>(m_unit); } | 108 CSSPrimitiveValue::UnitType unitType() const { return static_cast<CSSPrimiti
veValue::UnitType>(m_unit); } |
| 107 UChar32 unicodeRangeStart() const { ASSERT(m_type == UnicodeRangeToken); ret
urn m_unicodeRange.start; } | 109 UChar32 unicodeRangeStart() const { ASSERT(m_type == UnicodeRangeToken); ret
urn m_unicodeRange.start; } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 160 |
| 159 namespace WTF { | 161 namespace WTF { |
| 160 template <> | 162 template <> |
| 161 struct IsTriviallyMoveAssignable<blink::CSSParserToken> { | 163 struct IsTriviallyMoveAssignable<blink::CSSParserToken> { |
| 162 STATIC_ONLY(IsTriviallyMoveAssignable); | 164 STATIC_ONLY(IsTriviallyMoveAssignable); |
| 163 static const bool value = true; | 165 static const bool value = true; |
| 164 }; | 166 }; |
| 165 } | 167 } |
| 166 | 168 |
| 167 #endif // CSSSParserToken_h | 169 #endif // CSSSParserToken_h |
| OLD | NEW |