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

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

Issue 2115923002: Improve numeric value handling in CSS Parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: V2 Created 4 years, 4 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 "wtf/Allocator.h" 10 #include "wtf/Allocator.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 CSSValueID functionId() const; 112 CSSValueID functionId() const;
113 113
114 bool hasStringBacking() const; 114 bool hasStringBacking() const;
115 115
116 CSSPropertyID parseAsUnresolvedCSSPropertyID() const; 116 CSSPropertyID parseAsUnresolvedCSSPropertyID() const;
117 117
118 void serialize(StringBuilder&) const; 118 void serialize(StringBuilder&) const;
119 119
120 CSSParserToken copyWithUpdatedString(const StringView&) const; 120 CSSParserToken copyWithUpdatedString(const StringView&) const;
121 121
122 static bool isValidNumericValue(double);
123 bool isValidNumericValue() const;
124
125 private: 122 private:
126 void initValueFromStringView(StringView string) 123 void initValueFromStringView(StringView string)
127 { 124 {
128 m_valueLength = string.length(); 125 m_valueLength = string.length();
129 m_valueIs8Bit = string.is8Bit(); 126 m_valueIs8Bit = string.is8Bit();
130 m_valueDataCharRaw = string.bytes(); 127 m_valueDataCharRaw = string.bytes();
131 } 128 }
132 unsigned m_type : 6; // CSSParserTokenType 129 unsigned m_type : 6; // CSSParserTokenType
133 unsigned m_blockType : 2; // BlockType 130 unsigned m_blockType : 2; // BlockType
134 unsigned m_numericValueType : 1; // NumericValueType 131 unsigned m_numericValueType : 1; // NumericValueType
(...skipping 25 matching lines...) Expand all
160 157
161 namespace WTF { 158 namespace WTF {
162 template <> 159 template <>
163 struct IsTriviallyMoveAssignable<blink::CSSParserToken> { 160 struct IsTriviallyMoveAssignable<blink::CSSParserToken> {
164 STATIC_ONLY(IsTriviallyMoveAssignable); 161 STATIC_ONLY(IsTriviallyMoveAssignable);
165 static const bool value = true; 162 static const bool value = true;
166 }; 163 };
167 } 164 }
168 165
169 #endif // CSSSParserToken_h 166 #endif // CSSSParserToken_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698