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

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

Issue 209443003: Refactor unitTable access (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 | « no previous file | 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 ULength, 143 ULength,
144 UAngle, 144 UAngle,
145 UTime, 145 UTime,
146 UFrequency, 146 UFrequency,
147 UResolution, 147 UResolution,
148 UOther 148 UOther
149 }; 149 };
150 static UnitCategory unitCategory(CSSPrimitiveValue::UnitTypes); 150 static UnitCategory unitCategory(CSSPrimitiveValue::UnitTypes);
151 151
152 typedef HashMap<String, CSSPrimitiveValue::UnitTypes> UnitTable; 152 typedef HashMap<String, CSSPrimitiveValue::UnitTypes> UnitTable;
153 static UnitTable& getUnitTable(); 153 static UnitTypes fromName(const String& unit);
154 154
155 bool isAngle() const 155 bool isAngle() const
156 { 156 {
157 return m_primitiveUnitType == CSS_DEG 157 return m_primitiveUnitType == CSS_DEG
158 || m_primitiveUnitType == CSS_RAD 158 || m_primitiveUnitType == CSS_RAD
159 || m_primitiveUnitType == CSS_GRAD 159 || m_primitiveUnitType == CSS_GRAD
160 || m_primitiveUnitType == CSS_TURN; 160 || m_primitiveUnitType == CSS_TURN;
161 } 161 }
162 bool isAttr() const { return m_primitiveUnitType == CSS_ATTR; } 162 bool isAttr() const { return m_primitiveUnitType == CSS_ATTR; }
163 bool isCounter() const { return m_primitiveUnitType == CSS_COUNTER; } 163 bool isCounter() const { return m_primitiveUnitType == CSS_COUNTER; }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 Rect* rect; 406 Rect* rect;
407 Quad* quad; 407 Quad* quad;
408 } m_value; 408 } m_value;
409 }; 409 };
410 410
411 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); 411 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue());
412 412
413 } // namespace WebCore 413 } // namespace WebCore
414 414
415 #endif // CSSPrimitiveValue_h 415 #endif // CSSPrimitiveValue_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698