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

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

Issue 1896893004: Hook up style invalidation for CSS Paint API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@css-paint-register
Patch Set: Redo CSSParserToken::operator==() Created 4 years, 7 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
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 CSSParserToken(CSSParserTokenType, BlockType = NotBlock); 76 CSSParserToken(CSSParserTokenType, BlockType = NotBlock);
77 CSSParserToken(CSSParserTokenType, CSSParserString, BlockType = NotBlock); 77 CSSParserToken(CSSParserTokenType, CSSParserString, BlockType = NotBlock);
78 78
79 CSSParserToken(CSSParserTokenType, UChar); // for DelimiterToken 79 CSSParserToken(CSSParserTokenType, UChar); // for DelimiterToken
80 CSSParserToken(CSSParserTokenType, double, NumericValueType, NumericSign); / / for NumberToken 80 CSSParserToken(CSSParserTokenType, double, NumericValueType, NumericSign); / / for NumberToken
81 CSSParserToken(CSSParserTokenType, UChar32, UChar32); // for UnicodeRangeTok en 81 CSSParserToken(CSSParserTokenType, UChar32, UChar32); // for UnicodeRangeTok en
82 82
83 CSSParserToken(HashTokenType, CSSParserString); 83 CSSParserToken(HashTokenType, CSSParserString);
84 84
85 bool operator==(const CSSParserToken& other) const; 85 bool operator==(const CSSParserToken& other) const;
86 bool operator!=(const CSSParserToken& other) const { return !(*this == other ); }
86 87
87 // Converts NumberToken to DimensionToken. 88 // Converts NumberToken to DimensionToken.
88 void convertToDimensionWithUnit(CSSParserString); 89 void convertToDimensionWithUnit(CSSParserString);
89 90
90 // Converts NumberToken to PercentageToken. 91 // Converts NumberToken to PercentageToken.
91 void convertToPercentage(); 92 void convertToPercentage();
92 93
93 CSSParserTokenType type() const { return static_cast<CSSParserTokenType>(m_t ype); } 94 CSSParserTokenType type() const { return static_cast<CSSParserTokenType>(m_t ype); }
94 CSSParserString value() const 95 CSSParserString value() const
95 { 96 {
(...skipping 30 matching lines...) Expand all
126 m_valueLength = value.m_length; 127 m_valueLength = value.m_length;
127 m_valueIs8Bit = value.m_is8Bit; 128 m_valueIs8Bit = value.m_is8Bit;
128 m_valueDataCharRaw = value.m_data.charactersRaw; 129 m_valueDataCharRaw = value.m_data.charactersRaw;
129 } 130 }
130 unsigned m_type : 6; // CSSParserTokenType 131 unsigned m_type : 6; // CSSParserTokenType
131 unsigned m_blockType : 2; // BlockType 132 unsigned m_blockType : 2; // BlockType
132 unsigned m_numericValueType : 1; // NumericValueType 133 unsigned m_numericValueType : 1; // NumericValueType
133 unsigned m_numericSign : 2; // NumericSign 134 unsigned m_numericSign : 2; // NumericSign
134 unsigned m_unit : 7; // CSSPrimitiveValue::UnitType 135 unsigned m_unit : 7; // CSSPrimitiveValue::UnitType
135 136
137 bool valueDataCharRawEqual(const CSSParserToken& other) const;
138
136 // m_value... is an unpacked CSSParserString so that we can pack it 139 // m_value... is an unpacked CSSParserString so that we can pack it
137 // tightly with the rest of this object for a smaller object size. 140 // tightly with the rest of this object for a smaller object size.
138 bool m_valueIs8Bit : 1; 141 bool m_valueIs8Bit : 1;
139 unsigned m_valueLength; 142 unsigned m_valueLength;
140 const void* m_valueDataCharRaw; // Either LChar* or UChar*. 143 const void* m_valueDataCharRaw; // Either LChar* or UChar*.
141 144
142 union { 145 union {
143 UChar m_delimiter; 146 UChar m_delimiter;
144 HashTokenType m_hashTokenType; 147 HashTokenType m_hashTokenType;
145 double m_numericValue; 148 double m_numericValue;
(...skipping 10 matching lines...) Expand all
156 159
157 namespace WTF { 160 namespace WTF {
158 template <> 161 template <>
159 struct IsTriviallyMoveAssignable<blink::CSSParserToken> { 162 struct IsTriviallyMoveAssignable<blink::CSSParserToken> {
160 STATIC_ONLY(IsTriviallyMoveAssignable); 163 STATIC_ONLY(IsTriviallyMoveAssignable);
161 static const bool value = true; 164 static const bool value = true;
162 }; 165 };
163 } 166 }
164 167
165 #endif // CSSSParserToken_h 168 #endif // CSSSParserToken_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698