| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 CSS_DPCM = 32, | 106 CSS_DPCM = 32, |
| 107 CSS_FR = 33, | 107 CSS_FR = 33, |
| 108 CSS_PAIR = 100, // We envision this being exposed as a means of getting
computed style values for pairs (border-spacing/radius, background-position, etc
.) | 108 CSS_PAIR = 100, // We envision this being exposed as a means of getting
computed style values for pairs (border-spacing/radius, background-position, etc
.) |
| 109 CSS_UNICODE_RANGE = 102, | 109 CSS_UNICODE_RANGE = 102, |
| 110 | 110 |
| 111 // FIXME: This is only used in CSSParserValue, so it's probably better a
s part of the enum there | 111 // FIXME: This is only used in CSSParserValue, so it's probably better a
s part of the enum there |
| 112 CSS_PARSER_HEXCOLOR = 105, | 112 CSS_PARSER_HEXCOLOR = 105, |
| 113 | 113 |
| 114 // These are from CSS3 Values and Units, but that isn't a finished stand
ard yet | 114 // These are from CSS3 Values and Units, but that isn't a finished stand
ard yet |
| 115 CSS_TURN = 107, | 115 CSS_TURN = 107, |
| 116 CSS_REMS = 108, | 116 // CSS_REMS = 108, |
| 117 CSS_CHS = 109, | 117 CSS_CHS = 109, |
| 118 | 118 |
| 119 // This is used by the CSS Shapes draft | 119 // This is used by the CSS Shapes draft |
| 120 CSS_SHAPE = 111, | 120 CSS_SHAPE = 111, |
| 121 | 121 |
| 122 // Used by border images. | 122 // Used by border images. |
| 123 CSS_QUAD = 112, | 123 CSS_QUAD = 112, |
| 124 | 124 |
| 125 CSS_CALC = 113, | 125 CSS_CALC = 113, |
| 126 CSS_CALC_PERCENTAGE_WITH_NUMBER = 114, | 126 CSS_CALC_PERCENTAGE_WITH_NUMBER = 114, |
| 127 CSS_CALC_PERCENTAGE_WITH_LENGTH = 115, | 127 CSS_CALC_PERCENTAGE_WITH_LENGTH = 115, |
| 128 | 128 |
| 129 CSS_PROPERTY_ID = 117, | 129 CSS_PROPERTY_ID = 117, |
| 130 CSS_VALUE_ID = 118 | 130 CSS_VALUE_ID = 118 |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 enum LengthUnitType { | 133 enum LengthUnitType { |
| 134 UnitTypePixels = 0, | 134 UnitTypePixels = 0, |
| 135 UnitTypePercentage, | 135 UnitTypePercentage, |
| 136 UnitTypeFontSize, | 136 UnitTypeFontSize, |
| 137 UnitTypeFontXSize, | 137 UnitTypeFontXSize, |
| 138 UnitTypeRootFontSize, | |
| 139 UnitTypeZeroCharacterWidth, | 138 UnitTypeZeroCharacterWidth, |
| 140 UnitTypeViewportWidth, | 139 UnitTypeViewportWidth, |
| 141 UnitTypeViewportHeight, | 140 UnitTypeViewportHeight, |
| 142 UnitTypeViewportMin, | 141 UnitTypeViewportMin, |
| 143 UnitTypeViewportMax, | 142 UnitTypeViewportMax, |
| 144 | 143 |
| 145 // This value must come after the last length unit type to enable iterat
ion over the length unit types. | 144 // This value must come after the last length unit type to enable iterat
ion over the length unit types. |
| 146 LengthUnitTypeCount, | 145 LengthUnitTypeCount, |
| 147 }; | 146 }; |
| 148 | 147 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 170 || m_primitiveUnitType == CSS_RAD | 169 || m_primitiveUnitType == CSS_RAD |
| 171 || m_primitiveUnitType == CSS_GRAD | 170 || m_primitiveUnitType == CSS_GRAD |
| 172 || m_primitiveUnitType == CSS_TURN; | 171 || m_primitiveUnitType == CSS_TURN; |
| 173 } | 172 } |
| 174 bool isAttr() const { return m_primitiveUnitType == CSS_ATTR; } | 173 bool isAttr() const { return m_primitiveUnitType == CSS_ATTR; } |
| 175 bool isFontIndependentLength() const { return m_primitiveUnitType >= CSS_PX
&& m_primitiveUnitType <= CSS_PC; } | 174 bool isFontIndependentLength() const { return m_primitiveUnitType >= CSS_PX
&& m_primitiveUnitType <= CSS_PC; } |
| 176 bool isFontRelativeLength() const | 175 bool isFontRelativeLength() const |
| 177 { | 176 { |
| 178 return m_primitiveUnitType == CSS_EMS | 177 return m_primitiveUnitType == CSS_EMS |
| 179 || m_primitiveUnitType == CSS_EXS | 178 || m_primitiveUnitType == CSS_EXS |
| 180 || m_primitiveUnitType == CSS_REMS | |
| 181 || m_primitiveUnitType == CSS_CHS; | 179 || m_primitiveUnitType == CSS_CHS; |
| 182 } | 180 } |
| 183 bool isViewportPercentageLength() const { return isViewportPercentageLength(
static_cast<UnitType>(m_primitiveUnitType)); } | 181 bool isViewportPercentageLength() const { return isViewportPercentageLength(
static_cast<UnitType>(m_primitiveUnitType)); } |
| 184 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; } |
| 185 static bool isLength(UnitType type) | 183 static bool isLength(UnitType type) |
| 186 { | 184 { |
| 187 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_CHS || isViewp
ortPercentageLength(type); |
| 188 } | 186 } |
| 189 bool isLength() const { return isLength(primitiveType()); } | 187 bool isLength() const { return isLength(primitiveType()); } |
| 190 bool isNumber() const { return primitiveType() == CSS_NUMBER; } | 188 bool isNumber() const { return primitiveType() == CSS_NUMBER; } |
| 191 bool isPercentage() const { return primitiveType() == CSS_PERCENTAGE; } | 189 bool isPercentage() const { return primitiveType() == CSS_PERCENTAGE; } |
| 192 bool isPx() const { return primitiveType() == CSS_PX; } | 190 bool isPx() const { return primitiveType() == CSS_PX; } |
| 193 bool isRect() const { return m_primitiveUnitType == CSS_RECT; } | 191 bool isRect() const { return m_primitiveUnitType == CSS_RECT; } |
| 194 bool isRGBColor() const { return m_primitiveUnitType == CSS_RGBCOLOR; } | 192 bool isRGBColor() const { return m_primitiveUnitType == CSS_RGBCOLOR; } |
| 195 bool isShape() const { return m_primitiveUnitType == CSS_SHAPE; } | 193 bool isShape() const { return m_primitiveUnitType == CSS_SHAPE; } |
| 196 bool isString() const { return m_primitiveUnitType == CSS_STRING; } | 194 bool isString() const { return m_primitiveUnitType == CSS_STRING; } |
| 197 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; } |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 } m_value; | 387 } m_value; |
| 390 }; | 388 }; |
| 391 | 389 |
| 392 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray; | 390 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray; |
| 393 | 391 |
| 394 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); | 392 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); |
| 395 | 393 |
| 396 } // namespace blink | 394 } // namespace blink |
| 397 | 395 |
| 398 #endif // SKY_ENGINE_CORE_CSS_CSSPRIMITIVEVALUE_H_ | 396 #endif // SKY_ENGINE_CORE_CSS_CSSPRIMITIVEVALUE_H_ |
| OLD | NEW |