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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 Number, | 69 Number, |
70 Percentage, | 70 Percentage, |
71 Ems, | 71 Ems, |
72 Exs, | 72 Exs, |
73 Pixels, | 73 Pixels, |
74 Centimeters, | 74 Centimeters, |
75 Millimeters, | 75 Millimeters, |
76 Inches, | 76 Inches, |
77 Points, | 77 Points, |
78 Picas, | 78 Picas, |
| 79 UserUnits, // The SVG term for unitless lengths |
79 Degrees, | 80 Degrees, |
80 Radians, | 81 Radians, |
81 Gradians, | 82 Gradians, |
82 Turns, | 83 Turns, |
83 Milliseconds, | 84 Milliseconds, |
84 Seconds, | 85 Seconds, |
85 Hertz, | 86 Hertz, |
86 Kilohertz, | 87 Kilohertz, |
87 ViewportWidth, | 88 ViewportWidth, |
88 ViewportHeight, | 89 ViewportHeight, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 || type() == UnitType::Ems | 161 || type() == UnitType::Ems |
161 || type() == UnitType::Exs | 162 || type() == UnitType::Exs |
162 || type() == UnitType::Rems | 163 || type() == UnitType::Rems |
163 || type() == UnitType::Chs; | 164 || type() == UnitType::Chs; |
164 } | 165 } |
165 bool isQuirkyEms() const { return type() == UnitType::QuirkyEms; } | 166 bool isQuirkyEms() const { return type() == UnitType::QuirkyEms; } |
166 bool isViewportPercentageLength() const { return isViewportPercentageLength(
type()); } | 167 bool isViewportPercentageLength() const { return isViewportPercentageLength(
type()); } |
167 static bool isViewportPercentageLength(UnitType type) { return type >= UnitT
ype::ViewportWidth && type <= UnitType::ViewportMax; } | 168 static bool isViewportPercentageLength(UnitType type) { return type >= UnitT
ype::ViewportWidth && type <= UnitType::ViewportMax; } |
168 static bool isLength(UnitType type) | 169 static bool isLength(UnitType type) |
169 { | 170 { |
170 return (type >= UnitType::Ems && type <= UnitType::Picas) || type == Uni
tType::QuirkyEms || type == UnitType::Rems || type == UnitType::Chs || isViewpor
tPercentageLength(type); | 171 return (type >= UnitType::Ems && type <= UnitType::UserUnits) || type ==
UnitType::QuirkyEms || type == UnitType::Rems || type == UnitType::Chs || isVie
wportPercentageLength(type); |
171 } | 172 } |
172 bool isLength() const { return isLength(typeWithCalcResolved()); } | 173 bool isLength() const { return isLength(typeWithCalcResolved()); } |
173 bool isNumber() const { return typeWithCalcResolved() == UnitType::Number ||
typeWithCalcResolved() == UnitType::Integer; } | 174 bool isNumber() const { return typeWithCalcResolved() == UnitType::Number ||
typeWithCalcResolved() == UnitType::Integer; } |
174 bool isPercentage() const { return typeWithCalcResolved() == UnitType::Perce
ntage; } | 175 bool isPercentage() const { return typeWithCalcResolved() == UnitType::Perce
ntage; } |
175 bool isPx() const { return typeWithCalcResolved() == UnitType::Pixels; } | 176 bool isPx() const { return typeWithCalcResolved() == UnitType::Pixels; } |
176 bool isTime() const { return type() == UnitType::Seconds || type() == UnitTy
pe::Milliseconds; } | 177 bool isTime() const { return type() == UnitType::Seconds || type() == UnitTy
pe::Milliseconds; } |
177 bool isCalculated() const { return type() == UnitType::Calc; } | 178 bool isCalculated() const { return type() == UnitType::Calc; } |
178 bool isCalculatedPercentageWithNumber() const { return typeWithCalcResolved(
) == UnitType::CalcPercentageWithNumber; } | 179 bool isCalculatedPercentageWithNumber() const { return typeWithCalcResolved(
) == UnitType::CalcPercentageWithNumber; } |
179 bool isCalculatedPercentageWithLength() const { return typeWithCalcResolved(
) == UnitType::CalcPercentageWithLength; } | 180 bool isCalculatedPercentageWithLength() const { return typeWithCalcResolved(
) == UnitType::CalcPercentageWithLength; } |
180 static bool isDotsPerInch(UnitType type) { return type == UnitType::DotsPerI
nch; } | 181 static bool isDotsPerInch(UnitType type) { return type == UnitType::DotsPerI
nch; } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 }; | 282 }; |
282 | 283 |
283 using CSSLengthArray = CSSPrimitiveValue::CSSLengthArray; | 284 using CSSLengthArray = CSSPrimitiveValue::CSSLengthArray; |
284 using CSSLengthTypeArray = CSSPrimitiveValue::CSSLengthTypeArray; | 285 using CSSLengthTypeArray = CSSPrimitiveValue::CSSLengthTypeArray; |
285 | 286 |
286 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); | 287 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); |
287 | 288 |
288 } // namespace blink | 289 } // namespace blink |
289 | 290 |
290 #endif // CSSPrimitiveValue_h | 291 #endif // CSSPrimitiveValue_h |
OLD | NEW |