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

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

Issue 1636453002: Use ASCII case-insensitive matching for ident-likes in the CSS parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Consistent indentation in test. Created 4 years, 11 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // Converts NumberToken to PercentageToken. 121 // Converts NumberToken to PercentageToken.
122 void convertToPercentage(); 122 void convertToPercentage();
123 123
124 CSSParserTokenType type() const { return static_cast<CSSParserTokenType>(m_t ype); } 124 CSSParserTokenType type() const { return static_cast<CSSParserTokenType>(m_t ype); }
125 CSSParserString value() const 125 CSSParserString value() const
126 { 126 {
127 CSSParserString ret; 127 CSSParserString ret;
128 ret.initRaw(m_valueDataCharRaw, m_valueLength, m_valueIs8Bit); 128 ret.initRaw(m_valueDataCharRaw, m_valueLength, m_valueIs8Bit);
129 return ret; 129 return ret;
130 } 130 }
131 bool valueEqualsIgnoringCase(const char* str) const { return value().equalIg noringCase(str); } 131 template<unsigned matchLength>
132 bool valueEqualsIgnoringASCIICase(const char (&match)[matchLength]) const { return value().equalIgnoringASCIICase<matchLength>(match); }
132 133
133 UChar delimiter() const; 134 UChar delimiter() const;
134 NumericSign numericSign() const; 135 NumericSign numericSign() const;
135 NumericValueType numericValueType() const; 136 NumericValueType numericValueType() const;
136 double numericValue() const; 137 double numericValue() const;
137 HashTokenType hashTokenType() const { ASSERT(m_type == HashToken); return m_ hashTokenType; } 138 HashTokenType hashTokenType() const { ASSERT(m_type == HashToken); return m_ hashTokenType; }
138 BlockType blockType() const { return static_cast<BlockType>(m_blockType); } 139 BlockType blockType() const { return static_cast<BlockType>(m_blockType); }
139 CSSPrimitiveValue::UnitType unitType() const { return static_cast<CSSPrimiti veValue::UnitType>(m_unit); } 140 CSSPrimitiveValue::UnitType unitType() const { return static_cast<CSSPrimiti veValue::UnitType>(m_unit); }
140 UChar32 unicodeRangeStart() const { ASSERT(m_type == UnicodeRangeToken); ret urn m_unicodeRange.start; } 141 UChar32 unicodeRangeStart() const { ASSERT(m_type == UnicodeRangeToken); ret urn m_unicodeRange.start; }
141 UChar32 unicodeRangeEnd() const { ASSERT(m_type == UnicodeRangeToken); retur n m_unicodeRange.end; } 142 UChar32 unicodeRangeEnd() const { ASSERT(m_type == UnicodeRangeToken); retur n m_unicodeRange.end; }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 187
187 namespace WTF { 188 namespace WTF {
188 template <> 189 template <>
189 struct IsTriviallyMoveAssignable<blink::CSSParserToken> { 190 struct IsTriviallyMoveAssignable<blink::CSSParserToken> {
190 STATIC_ONLY(IsTriviallyMoveAssignable); 191 STATIC_ONLY(IsTriviallyMoveAssignable);
191 static const bool value = true; 192 static const bool value = true;
192 }; 193 };
193 } 194 }
194 195
195 #endif // CSSSParserToken_h 196 #endif // CSSSParserToken_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698