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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 CSS_RECT = 24, | 99 CSS_RECT = 24, |
100 CSS_RGBCOLOR = 25, | 100 CSS_RGBCOLOR = 25, |
101 CSS_VW = 26, | 101 CSS_VW = 26, |
102 CSS_VH = 27, | 102 CSS_VH = 27, |
103 CSS_VMIN = 28, | 103 CSS_VMIN = 28, |
104 CSS_VMAX = 29, | 104 CSS_VMAX = 29, |
105 CSS_DPPX = 30, | 105 CSS_DPPX = 30, |
106 CSS_DPI = 31, | 106 CSS_DPI = 31, |
107 CSS_DPCM = 32, | 107 CSS_DPCM = 32, |
108 CSS_FR = 33, | 108 CSS_FR = 33, |
| 109 CSS_INTEGER = 34, |
109 CSS_PAIR = 100, | 110 CSS_PAIR = 100, |
110 CSS_TURN = 107, | 111 CSS_TURN = 107, |
111 CSS_REMS = 108, | 112 CSS_REMS = 108, |
112 CSS_CHS = 109, | 113 CSS_CHS = 109, |
113 CSS_SHAPE = 111, | 114 CSS_SHAPE = 111, |
114 CSS_QUAD = 112, | 115 CSS_QUAD = 112, |
115 CSS_CALC = 113, | 116 CSS_CALC = 113, |
116 CSS_CALC_PERCENTAGE_WITH_NUMBER = 114, | 117 CSS_CALC_PERCENTAGE_WITH_NUMBER = 114, |
117 CSS_CALC_PERCENTAGE_WITH_LENGTH = 115, | 118 CSS_CALC_PERCENTAGE_WITH_LENGTH = 115, |
118 CSS_STRING = 116, | 119 CSS_STRING = 116, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 || m_primitiveUnitType == CSS_REMS | 178 || m_primitiveUnitType == CSS_REMS |
178 || m_primitiveUnitType == CSS_CHS; | 179 || m_primitiveUnitType == CSS_CHS; |
179 } | 180 } |
180 bool isViewportPercentageLength() const { return isViewportPercentageLength(
static_cast<UnitType>(m_primitiveUnitType)); } | 181 bool isViewportPercentageLength() const { return isViewportPercentageLength(
static_cast<UnitType>(m_primitiveUnitType)); } |
181 static bool isViewportPercentageLength(UnitType type) { return type >= CSS_V
W && type <= CSS_VMAX; } | 182 static bool isViewportPercentageLength(UnitType type) { return type >= CSS_V
W && type <= CSS_VMAX; } |
182 static bool isLength(UnitType type) | 183 static bool isLength(UnitType type) |
183 { | 184 { |
184 return (type >= CSS_EMS && type <= CSS_PC) || type == CSS_REMS || type =
= CSS_CHS || isViewportPercentageLength(type); | 185 return (type >= CSS_EMS && type <= CSS_PC) || type == CSS_REMS || type =
= CSS_CHS || isViewportPercentageLength(type); |
185 } | 186 } |
186 bool isLength() const { return isLength(primitiveType()); } | 187 bool isLength() const { return isLength(primitiveType()); } |
187 bool isNumber() const { return primitiveType() == CSS_NUMBER; } | 188 bool isNumber() const { return primitiveType() == CSS_NUMBER || primitiveTyp
e() == CSS_INTEGER; } |
188 bool isPercentage() const { return primitiveType() == CSS_PERCENTAGE; } | 189 bool isPercentage() const { return primitiveType() == CSS_PERCENTAGE; } |
189 bool isPx() const { return primitiveType() == CSS_PX; } | 190 bool isPx() const { return primitiveType() == CSS_PX; } |
190 bool isRect() const { return m_primitiveUnitType == CSS_RECT; } | 191 bool isRect() const { return m_primitiveUnitType == CSS_RECT; } |
191 bool isRGBColor() const { return m_primitiveUnitType == CSS_RGBCOLOR; } | 192 bool isRGBColor() const { return m_primitiveUnitType == CSS_RGBCOLOR; } |
192 bool isShape() const { return m_primitiveUnitType == CSS_SHAPE; } | 193 bool isShape() const { return m_primitiveUnitType == CSS_SHAPE; } |
193 bool isString() const { return m_primitiveUnitType == CSS_STRING; } | 194 bool isString() const { return m_primitiveUnitType == CSS_STRING; } |
194 bool isTime() const { return m_primitiveUnitType == CSS_S || m_primitiveUnit
Type == CSS_MS; } | 195 bool isTime() const { return m_primitiveUnitType == CSS_S || m_primitiveUnit
Type == CSS_MS; } |
195 bool isURI() const { return m_primitiveUnitType == CSS_URI; } | 196 bool isURI() const { return m_primitiveUnitType == CSS_URI; } |
196 bool isCalculated() const { return m_primitiveUnitType == CSS_CALC; } | 197 bool isCalculated() const { return m_primitiveUnitType == CSS_CALC; } |
197 bool isCalculatedPercentageWithNumber() const { return primitiveType() == CS
S_CALC_PERCENTAGE_WITH_NUMBER; } | 198 bool isCalculatedPercentageWithNumber() const { return primitiveType() == CS
S_CALC_PERCENTAGE_WITH_NUMBER; } |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 }; | 360 }; |
360 | 361 |
361 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray; | 362 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray; |
362 typedef CSSPrimitiveValue::CSSLengthTypeArray CSSLengthTypeArray; | 363 typedef CSSPrimitiveValue::CSSLengthTypeArray CSSLengthTypeArray; |
363 | 364 |
364 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); | 365 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); |
365 | 366 |
366 } // namespace blink | 367 } // namespace blink |
367 | 368 |
368 #endif // CSSPrimitiveValue_h | 369 #endif // CSSPrimitiveValue_h |
OLD | NEW |