OLD | NEW |
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 UPercent, | 142 UPercent, |
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; |
| 153 static UnitTable& getUnitTable(); |
| 154 |
152 bool isAngle() const | 155 bool isAngle() const |
153 { | 156 { |
154 return m_primitiveUnitType == CSS_DEG | 157 return m_primitiveUnitType == CSS_DEG |
155 || m_primitiveUnitType == CSS_RAD | 158 || m_primitiveUnitType == CSS_RAD |
156 || m_primitiveUnitType == CSS_GRAD | 159 || m_primitiveUnitType == CSS_GRAD |
157 || m_primitiveUnitType == CSS_TURN; | 160 || m_primitiveUnitType == CSS_TURN; |
158 } | 161 } |
159 bool isAttr() const { return m_primitiveUnitType == CSS_ATTR; } | 162 bool isAttr() const { return m_primitiveUnitType == CSS_ATTR; } |
160 bool isCounter() const { return m_primitiveUnitType == CSS_COUNTER; } | 163 bool isCounter() const { return m_primitiveUnitType == CSS_COUNTER; } |
161 bool isFontIndependentLength() const { return m_primitiveUnitType >= CSS_PX
&& m_primitiveUnitType <= CSS_PC; } | 164 bool isFontIndependentLength() const { return m_primitiveUnitType >= CSS_PX
&& m_primitiveUnitType <= CSS_PC; } |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 Rect* rect; | 406 Rect* rect; |
404 Quad* quad; | 407 Quad* quad; |
405 } m_value; | 408 } m_value; |
406 }; | 409 }; |
407 | 410 |
408 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); | 411 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); |
409 | 412 |
410 } // namespace WebCore | 413 } // namespace WebCore |
411 | 414 |
412 #endif // CSSPrimitiveValue_h | 415 #endif // CSSPrimitiveValue_h |
OLD | NEW |