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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 243 |
244 double getDoubleValue() const; | 244 double getDoubleValue() const; |
245 float getFloatValue() const { return getValue<float>(); } | 245 float getFloatValue() const { return getValue<float>(); } |
246 int getIntValue() const { return getValue<int>(); } | 246 int getIntValue() const { return getValue<int>(); } |
247 template <typename T> | 247 template <typename T> |
248 inline T getValue() const { | 248 inline T getValue() const { |
249 return clampTo<T>(getDoubleValue()); | 249 return clampTo<T>(getDoubleValue()); |
250 } | 250 } |
251 | 251 |
252 CSSCalcValue* cssCalcValue() const { | 252 CSSCalcValue* cssCalcValue() const { |
253 ASSERT(isCalculated()); | 253 DCHECK(isCalculated()); |
254 return m_value.calc; | 254 return m_value.calc; |
255 } | 255 } |
256 | 256 |
257 template <typename T> | 257 template <typename T> |
258 inline T convertTo() const; // Defined in CSSPrimitiveValueMappings.h | 258 inline T convertTo() const; // Defined in CSSPrimitiveValueMappings.h |
259 | 259 |
260 static const char* unitTypeToString(UnitType); | 260 static const char* unitTypeToString(UnitType); |
261 static UnitType stringToUnitType(StringView string) { | 261 static UnitType stringToUnitType(StringView string) { |
262 if (string.is8Bit()) | 262 if (string.is8Bit()) |
263 return stringToUnitType(string.characters8(), string.length()); | 263 return stringToUnitType(string.characters8(), string.length()); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 } m_value; | 317 } m_value; |
318 }; | 318 }; |
319 | 319 |
320 using CSSLengthArray = CSSPrimitiveValue::CSSLengthArray; | 320 using CSSLengthArray = CSSPrimitiveValue::CSSLengthArray; |
321 | 321 |
322 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); | 322 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); |
323 | 323 |
324 } // namespace blink | 324 } // namespace blink |
325 | 325 |
326 #endif // CSSPrimitiveValue_h | 326 #endif // CSSPrimitiveValue_h |
OLD | NEW |