OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void newValueSpecifiedUnits(CSSPrimitiveValue::UnitType, float valueInSpecif
iedUnits); | 80 void newValueSpecifiedUnits(CSSPrimitiveValue::UnitType, float valueInSpecif
iedUnits); |
81 void convertToSpecifiedUnits(CSSPrimitiveValue::UnitType, const SVGLengthCon
text&); | 81 void convertToSpecifiedUnits(CSSPrimitiveValue::UnitType, const SVGLengthCon
text&); |
82 | 82 |
83 // Helper functions | 83 // Helper functions |
84 static inline bool isRelativeUnit(CSSPrimitiveValue::UnitType unitType) | 84 static inline bool isRelativeUnit(CSSPrimitiveValue::UnitType unitType) |
85 { | 85 { |
86 return unitType == CSSPrimitiveValue::UnitType::Percentage | 86 return unitType == CSSPrimitiveValue::UnitType::Percentage |
87 || unitType == CSSPrimitiveValue::UnitType::Ems | 87 || unitType == CSSPrimitiveValue::UnitType::Ems |
88 || unitType == CSSPrimitiveValue::UnitType::Exs | 88 || unitType == CSSPrimitiveValue::UnitType::Exs |
89 || unitType == CSSPrimitiveValue::UnitType::Rems | 89 || unitType == CSSPrimitiveValue::UnitType::Rems |
90 || unitType == CSSPrimitiveValue::UnitType::Chs; | 90 || unitType == CSSPrimitiveValue::UnitType::Chs |
| 91 || (unitType >= CSSPrimitiveValue::UnitType::ViewportWidth && unitTy
pe <= CSSPrimitiveValue::UnitType::ViewportMax); |
91 } | 92 } |
92 inline bool isRelative() const { return isRelativeUnit(m_value->typeWithCalc
Resolved()); } | 93 inline bool isRelative() const { return isRelativeUnit(m_value->typeWithCalc
Resolved()); } |
93 | 94 |
94 bool isZero() const | 95 bool isZero() const |
95 { | 96 { |
96 return m_value->getFloatValue() == 0; | 97 return m_value->getFloatValue() == 0; |
97 } | 98 } |
98 | 99 |
99 static SVGLengthMode lengthModeForAnimatedLengthAttribute(const QualifiedNam
e&); | 100 static SVGLengthMode lengthModeForAnimatedLengthAttribute(const QualifiedNam
e&); |
100 static bool negativeValuesForbiddenForAnimatedLengthAttribute(const Qualifie
dName&); | 101 static bool negativeValuesForbiddenForAnimatedLengthAttribute(const Qualifie
dName&); |
(...skipping 10 matching lines...) Expand all Loading... |
111 | 112 |
112 RefPtrWillBeMember<CSSPrimitiveValue> m_value; | 113 RefPtrWillBeMember<CSSPrimitiveValue> m_value; |
113 unsigned m_unitMode : 2; | 114 unsigned m_unitMode : 2; |
114 }; | 115 }; |
115 | 116 |
116 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGLength); | 117 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGLength); |
117 | 118 |
118 } // namespace blink | 119 } // namespace blink |
119 | 120 |
120 #endif // SVGLength_h | 121 #endif // SVGLength_h |
OLD | NEW |