| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 if (proximityToNextInt <= 0.01 && value > 0) | 63 if (proximityToNextInt <= 0.01 && value > 0) |
| 64 return static_cast<float>(ceiledValue); | 64 return static_cast<float>(ceiledValue); |
| 65 if (proximityToNextInt >= 0.99 && value < 0) | 65 if (proximityToNextInt >= 0.99 && value < 0) |
| 66 return static_cast<float>(floor(value)); | 66 return static_cast<float>(floor(value)); |
| 67 return static_cast<float>(value); | 67 return static_cast<float>(value); |
| 68 } | 68 } |
| 69 | 69 |
| 70 // CSSPrimitiveValues are immutable. This class has manual ref-counting | 70 // CSSPrimitiveValues are immutable. This class has manual ref-counting |
| 71 // of unioned types and does not have the code necessary | 71 // of unioned types and does not have the code necessary |
| 72 // to handle any kind of mutations. | 72 // to handle any kind of mutations. |
| 73 class CORE_EXPORT CSSPrimitiveValue : public CSSValue { | 73 class CORE_EXPORT CSSPrimitiveValue : public CSSValueObject { |
| 74 public: | 74 public: |
| 75 enum UnitType { | 75 enum UnitType { |
| 76 CSS_UNKNOWN = 0, | 76 CSS_UNKNOWN = 0, |
| 77 CSS_NUMBER = 1, | 77 CSS_NUMBER = 1, |
| 78 CSS_PERCENTAGE = 2, | 78 CSS_PERCENTAGE = 2, |
| 79 CSS_EMS = 3, | 79 CSS_EMS = 3, |
| 80 CSS_EXS = 4, | 80 CSS_EXS = 4, |
| 81 CSS_PX = 5, | 81 CSS_PX = 5, |
| 82 CSS_CM = 6, | 82 CSS_CM = 6, |
| 83 CSS_MM = 7, | 83 CSS_MM = 7, |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 CSSPrimitiveValue(CSSValueID); | 309 CSSPrimitiveValue(CSSValueID); |
| 310 CSSPrimitiveValue(CSSPropertyID); | 310 CSSPrimitiveValue(CSSPropertyID); |
| 311 CSSPrimitiveValue(RGBA32 color); | 311 CSSPrimitiveValue(RGBA32 color); |
| 312 CSSPrimitiveValue(const Length&, float zoom); | 312 CSSPrimitiveValue(const Length&, float zoom); |
| 313 CSSPrimitiveValue(const LengthSize&, const ComputedStyle&); | 313 CSSPrimitiveValue(const LengthSize&, const ComputedStyle&); |
| 314 CSSPrimitiveValue(const String&, UnitType); | 314 CSSPrimitiveValue(const String&, UnitType); |
| 315 CSSPrimitiveValue(double, UnitType); | 315 CSSPrimitiveValue(double, UnitType); |
| 316 | 316 |
| 317 template<typename T> CSSPrimitiveValue(T); // Defined in CSSPrimitiveValueMa
ppings.h | 317 template<typename T> CSSPrimitiveValue(T); // Defined in CSSPrimitiveValueMa
ppings.h |
| 318 template<typename T> CSSPrimitiveValue(T* val) | 318 template<typename T> CSSPrimitiveValue(T* val) |
| 319 : CSSValue(PrimitiveClass) | 319 : CSSValueObject(PrimitiveClass) |
| 320 { | 320 { |
| 321 init(PassRefPtrWillBeRawPtr<T>(val)); | 321 init(PassRefPtrWillBeRawPtr<T>(val)); |
| 322 } | 322 } |
| 323 | 323 |
| 324 template<typename T> CSSPrimitiveValue(PassRefPtrWillBeRawPtr<T> val) | 324 template<typename T> CSSPrimitiveValue(PassRefPtrWillBeRawPtr<T> val) |
| 325 : CSSValue(PrimitiveClass) | 325 : CSSValueObject(PrimitiveClass) |
| 326 { | 326 { |
| 327 init(val); | 327 init(val); |
| 328 } | 328 } |
| 329 | 329 |
| 330 static void create(int); // compile-time guard | 330 static void create(int); // compile-time guard |
| 331 static void create(unsigned); // compile-time guard | 331 static void create(unsigned); // compile-time guard |
| 332 template<typename T> operator T*(); // compile-time guard | 332 template<typename T> operator T*(); // compile-time guard |
| 333 | 333 |
| 334 void init(const Length&); | 334 void init(const Length&); |
| 335 void init(const LengthSize&, const ComputedStyle&); | 335 void init(const LengthSize&, const ComputedStyle&); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 359 }; | 359 }; |
| 360 | 360 |
| 361 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray; | 361 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray; |
| 362 typedef CSSPrimitiveValue::CSSLengthTypeArray CSSLengthTypeArray; | 362 typedef CSSPrimitiveValue::CSSLengthTypeArray CSSLengthTypeArray; |
| 363 | 363 |
| 364 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); | 364 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); |
| 365 | 365 |
| 366 } // namespace blink | 366 } // namespace blink |
| 367 | 367 |
| 368 #endif // CSSPrimitiveValue_h | 368 #endif // CSSPrimitiveValue_h |
| OLD | NEW |