Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSParserToken.h

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Post-merge Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "core/css/parser/CSSParserString.h" 10 #include "core/css/parser/CSSParserString.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 enum NumericValueType { 57 enum NumericValueType {
58 IntegerValueType, 58 IntegerValueType,
59 NumberValueType, 59 NumberValueType,
60 }; 60 };
61 61
62 enum HashTokenType { 62 enum HashTokenType {
63 HashTokenId, 63 HashTokenId,
64 HashTokenUnrestricted, 64 HashTokenUnrestricted,
65 }; 65 };
66 66
67 class CSSVariableData;
68
67 class CORE_EXPORT CSSParserToken { 69 class CORE_EXPORT CSSParserToken {
68 WTF_MAKE_FAST_ALLOCATED(CSSParserToken); 70 WTF_MAKE_FAST_ALLOCATED(CSSParserToken);
69 public: 71 public:
70 enum BlockType { 72 enum BlockType {
71 NotBlock, 73 NotBlock,
72 BlockStart, 74 BlockStart,
73 BlockEnd, 75 BlockEnd,
74 }; 76 };
75 77
76 CSSParserToken(CSSParserTokenType, BlockType = NotBlock); 78 CSSParserToken(CSSParserTokenType, BlockType = NotBlock);
(...skipping 25 matching lines...) Expand all
102 NumericValueType numericValueType() const; 104 NumericValueType numericValueType() const;
103 double numericValue() const; 105 double numericValue() const;
104 HashTokenType hashTokenType() const { ASSERT(m_type == HashToken); return m_ hashTokenType; } 106 HashTokenType hashTokenType() const { ASSERT(m_type == HashToken); return m_ hashTokenType; }
105 BlockType blockType() const { return static_cast<BlockType>(m_blockType); } 107 BlockType blockType() 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; }
108 UChar32 unicodeRangeEnd() const { ASSERT(m_type == UnicodeRangeToken); retur n m_unicodeRange.end; } 110 UChar32 unicodeRangeEnd() const { ASSERT(m_type == UnicodeRangeToken); retur n m_unicodeRange.end; }
109 CSSValueID id() const; 111 CSSValueID id() const;
110 CSSValueID functionId() const; 112 CSSValueID functionId() const;
111 113
114 bool needsStringBacking() const;
Timothy Loh 2015/09/30 02:09:28 needs -> has?
115
116 bool valueIs8Bit() const { return m_valueIs8Bit; }
117
112 CSSPropertyID parseAsUnresolvedCSSPropertyID() const; 118 CSSPropertyID parseAsUnresolvedCSSPropertyID() const;
113 119
114 void serialize(StringBuilder&) const; 120 void serialize(StringBuilder&) const;
115 121
116 private: 122 private:
117 void initValueFromCSSParserString(const CSSParserString& value) 123 void initValueFromCSSParserString(const CSSParserString& value)
118 { 124 {
119 m_valueLength = value.m_length; 125 m_valueLength = value.m_length;
120 m_valueIs8Bit = value.m_is8Bit; 126 m_valueIs8Bit = value.m_is8Bit;
121 m_valueDataCharRaw = value.m_data.charactersRaw; 127 m_valueDataCharRaw = value.m_data.charactersRaw;
(...skipping 14 matching lines...) Expand all
136 UChar m_delimiter; 142 UChar m_delimiter;
137 HashTokenType m_hashTokenType; 143 HashTokenType m_hashTokenType;
138 double m_numericValue; 144 double m_numericValue;
139 mutable int m_id; 145 mutable int m_id;
140 146
141 struct { 147 struct {
142 UChar32 start; 148 UChar32 start;
143 UChar32 end; 149 UChar32 end;
144 } m_unicodeRange; 150 } m_unicodeRange;
145 }; 151 };
152
153 friend CSSVariableData;
146 }; 154 };
147 155
148 } // namespace blink 156 } // namespace blink
149 157
150 namespace WTF { 158 namespace WTF {
151 template <> 159 template <>
152 struct IsTriviallyMoveAssignable<blink::CSSParserToken> { 160 struct IsTriviallyMoveAssignable<blink::CSSParserToken> {
153 STATIC_ONLY(IsTriviallyMoveAssignable); 161 STATIC_ONLY(IsTriviallyMoveAssignable);
154 static const bool value = true; 162 static const bool value = true;
155 }; 163 };
156 } 164 }
157 165
158 #endif // CSSSParserToken_h 166 #endif // CSSSParserToken_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698