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

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

Issue 1938343002: Generate a series of nested switch statements to parse CSSPrimitiveValue units. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 ULength, 151 ULength,
152 UAngle, 152 UAngle,
153 UTime, 153 UTime,
154 UFrequency, 154 UFrequency,
155 UResolution, 155 UResolution,
156 UOther 156 UOther
157 }; 157 };
158 static UnitCategory unitTypeToUnitCategory(UnitType); 158 static UnitCategory unitTypeToUnitCategory(UnitType);
159 static float clampToCSSLengthRange(double); 159 static float clampToCSSLengthRange(double);
160 160
161 static void initUnitTable();
162
163 static UnitType fromName(const String& unit);
164
165 bool isAngle() const 161 bool isAngle() const
166 { 162 {
167 return type() == UnitType::Degrees 163 return type() == UnitType::Degrees
168 || type() == UnitType::Radians 164 || type() == UnitType::Radians
169 || type() == UnitType::Gradians 165 || type() == UnitType::Gradians
170 || type() == UnitType::Turns; 166 || type() == UnitType::Turns;
171 } 167 }
172 bool isFontRelativeLength() const 168 bool isFontRelativeLength() const
173 { 169 {
174 return type() == UnitType::QuirkyEms 170 return type() == UnitType::QuirkyEms
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } m_value; 292 } m_value;
297 }; 293 };
298 294
299 using CSSLengthArray = CSSPrimitiveValue::CSSLengthArray; 295 using CSSLengthArray = CSSPrimitiveValue::CSSLengthArray;
300 296
301 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); 297 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue());
302 298
303 } // namespace blink 299 } // namespace blink
304 300
305 #endif // CSSPrimitiveValue_h 301 #endif // CSSPrimitiveValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698