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 #include "core/css/cssom/CSSAngleValue.h" | 5 #include "core/css/cssom/CSSAngleValue.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "core/css/CSSPrimitiveValue.h" | 8 #include "core/css/CSSPrimitiveValue.h" |
9 #include "wtf/MathExtras.h" | 9 #include "wtf/MathExtras.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
| 12 namespace cssom { |
12 | 13 |
13 CSSAngleValue* CSSAngleValue::create(double value, const String& unit, Exception
State& exceptionState) | 14 CSSAngleValue* CSSAngleValue::create(double value, const String& unit, Exception
State& exceptionState) |
14 { | 15 { |
15 CSSPrimitiveValue::UnitType primitiveUnit = CSSPrimitiveValue::stringToUnitT
ype(unit); | 16 CSSPrimitiveValue::UnitType primitiveUnit = CSSPrimitiveValue::stringToUnitT
ype(unit); |
16 DCHECK(CSSPrimitiveValue::isAngle(primitiveUnit)); | 17 DCHECK(CSSPrimitiveValue::isAngle(primitiveUnit)); |
17 return new CSSAngleValue(value, primitiveUnit); | 18 return new CSSAngleValue(value, primitiveUnit); |
18 } | 19 } |
19 | 20 |
20 double CSSAngleValue::degrees() const | 21 double CSSAngleValue::degrees() const |
21 { | 22 { |
(...skipping 25 matching lines...) Expand all Loading... |
47 double CSSAngleValue::turns() const | 48 double CSSAngleValue::turns() const |
48 { | 49 { |
49 return deg2turn(degrees()); | 50 return deg2turn(degrees()); |
50 } | 51 } |
51 | 52 |
52 CSSValue* CSSAngleValue::toCSSValue() const | 53 CSSValue* CSSAngleValue::toCSSValue() const |
53 { | 54 { |
54 return CSSPrimitiveValue::create(m_value, m_unit); | 55 return CSSPrimitiveValue::create(m_value, m_unit); |
55 } | 56 } |
56 | 57 |
| 58 } // namespace cssom |
57 } // namespace blink | 59 } // namespace blink |
| 60 |
OLD | NEW |