| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CSSAngleValue_h | |
| 6 #define CSSAngleValue_h | |
| 7 | |
| 8 #include "core/css/CSSPrimitiveValue.h" | |
| 9 #include "core/css/cssom/CSSStyleValue.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 class CORE_EXPORT CSSAngleValue final : public CSSStyleValue { | |
| 14 WTF_MAKE_NONCOPYABLE(CSSAngleValue); | |
| 15 DEFINE_WRAPPERTYPEINFO(); | |
| 16 | |
| 17 public: | |
| 18 static CSSAngleValue* Create(double value, const String& unit); | |
| 19 static CSSAngleValue* Create(double value, CSSPrimitiveValue::UnitType); | |
| 20 static CSSAngleValue* FromCSSValue(const CSSPrimitiveValue&); | |
| 21 | |
| 22 StyleValueType GetType() const override { return kAngleType; } | |
| 23 | |
| 24 double degrees() const; | |
| 25 double radians() const; | |
| 26 double gradians() const; | |
| 27 double turns() const; | |
| 28 | |
| 29 double Value() const { return value_; } | |
| 30 CSSPrimitiveValue::UnitType Unit() const { return unit_; } | |
| 31 CSSValue* ToCSSValue() const override; | |
| 32 | |
| 33 private: | |
| 34 CSSAngleValue(double value, CSSPrimitiveValue::UnitType unit) | |
| 35 : value_(value), unit_(unit) {} | |
| 36 | |
| 37 double value_; | |
| 38 CSSPrimitiveValue::UnitType unit_; | |
| 39 }; | |
| 40 } | |
| 41 | |
| 42 #endif // CSSAngleValue_h | |
| OLD | NEW |