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

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

Issue 1319453002: Experiment: Switch to code-driven conversion of CSS unit type names. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: drop redundant namespace prefix Created 5 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
« no previous file with comments | « Source/core/Init.cpp ('k') | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 ULength, 149 ULength,
150 UAngle, 150 UAngle,
151 UTime, 151 UTime,
152 UFrequency, 152 UFrequency,
153 UResolution, 153 UResolution,
154 UOther 154 UOther
155 }; 155 };
156 static UnitCategory unitCategory(UnitType); 156 static UnitCategory unitCategory(UnitType);
157 static float clampToCSSLengthRange(double); 157 static float clampToCSSLengthRange(double);
158 158
159 static void initUnitTable(); 159 static UnitType fromName(const UChar* unit, unsigned length);
160 160 static UnitType fromName(const LChar* unit, unsigned length);
161 static UnitType fromName(const String& unit);
162 161
163 bool isAngle() const 162 bool isAngle() const
164 { 163 {
165 return type() == UnitType::Degrees 164 return type() == UnitType::Degrees
166 || type() == UnitType::Radians 165 || type() == UnitType::Radians
167 || type() == UnitType::Gradians 166 || type() == UnitType::Gradians
168 || type() == UnitType::Turns; 167 || type() == UnitType::Turns;
169 } 168 }
170 bool isAttr() const { return type() == UnitType::Attribute; } 169 bool isAttr() const { return type() == UnitType::Attribute; }
171 bool isCounter() const { return type() == UnitType::Counter; } 170 bool isCounter() const { return type() == UnitType::Counter; }
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 }; 360 };
362 361
363 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray; 362 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray;
364 typedef CSSPrimitiveValue::CSSLengthTypeArray CSSLengthTypeArray; 363 typedef CSSPrimitiveValue::CSSLengthTypeArray CSSLengthTypeArray;
365 364
366 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); 365 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue());
367 366
368 } // namespace blink 367 } // namespace blink
369 368
370 #endif // CSSPrimitiveValue_h 369 #endif // CSSPrimitiveValue_h
OLDNEW
« no previous file with comments | « Source/core/Init.cpp ('k') | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698