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