| 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/CSSRotation.h" | 5 #include "core/css/cssom/CSSRotation.h" |
| 6 | 6 |
| 7 #include "core/css/CSSFunctionValue.h" | 7 #include "core/css/CSSFunctionValue.h" |
| 8 #include "core/css/CSSPrimitiveValue.h" | 8 #include "core/css/CSSPrimitiveValue.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 namespace cssom { |
| 11 | 12 |
| 12 namespace { | 13 namespace { |
| 13 | 14 |
| 14 bool isNumberValue(const CSSValue& value) | 15 bool isNumberValue(const CSSValue& value) |
| 15 { | 16 { |
| 16 return value.isPrimitiveValue() && toCSSPrimitiveValue(value).isNumber(); | 17 return value.isPrimitiveValue() && toCSSPrimitiveValue(value).isNumber(); |
| 17 } | 18 } |
| 18 | 19 |
| 19 CSSRotation* fromCSSRotate(const CSSFunctionValue& value) | 20 CSSRotation* fromCSSRotate(const CSSFunctionValue& value) |
| 20 { | 21 { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 CSSFunctionValue* result = CSSFunctionValue::create(m_is2D ? CSSValueRotate
: CSSValueRotate3d); | 80 CSSFunctionValue* result = CSSFunctionValue::create(m_is2D ? CSSValueRotate
: CSSValueRotate3d); |
| 80 if (!m_is2D) { | 81 if (!m_is2D) { |
| 81 result->append(*CSSPrimitiveValue::create(m_x, CSSPrimitiveValue::UnitTy
pe::Number)); | 82 result->append(*CSSPrimitiveValue::create(m_x, CSSPrimitiveValue::UnitTy
pe::Number)); |
| 82 result->append(*CSSPrimitiveValue::create(m_y, CSSPrimitiveValue::UnitTy
pe::Number)); | 83 result->append(*CSSPrimitiveValue::create(m_y, CSSPrimitiveValue::UnitTy
pe::Number)); |
| 83 result->append(*CSSPrimitiveValue::create(m_z, CSSPrimitiveValue::UnitTy
pe::Number)); | 84 result->append(*CSSPrimitiveValue::create(m_z, CSSPrimitiveValue::UnitTy
pe::Number)); |
| 84 } | 85 } |
| 85 result->append(*CSSPrimitiveValue::create(m_angle, CSSPrimitiveValue::UnitTy
pe::Degrees)); | 86 result->append(*CSSPrimitiveValue::create(m_angle, CSSPrimitiveValue::UnitTy
pe::Degrees)); |
| 86 return result; | 87 return result; |
| 87 } | 88 } |
| 88 | 89 |
| 90 } // namespace cssom |
| 89 } // namespace blink | 91 } // namespace blink |
| 92 |
| OLD | NEW |