| 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/CSSTransformComponent.h" | 5 #include "core/css/cssom/CSSTransformComponent.h" |
| 6 | 6 |
| 7 #include "core/css/cssom/CSSMatrixTransformComponent.h" | 7 #include "core/css/cssom/CSSMatrixComponent.h" |
| 8 #include "core/css/cssom/CSSPerspective.h" | 8 #include "core/css/cssom/CSSPerspective.h" |
| 9 #include "core/css/cssom/CSSRotation.h" | 9 #include "core/css/cssom/CSSRotation.h" |
| 10 #include "core/css/cssom/CSSScale.h" | 10 #include "core/css/cssom/CSSScale.h" |
| 11 #include "core/css/cssom/CSSSkew.h" | 11 #include "core/css/cssom/CSSSkew.h" |
| 12 #include "core/css/cssom/CSSTranslation.h" | 12 #include "core/css/cssom/CSSTranslation.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 CSSTransformComponent* CSSTransformComponent::fromCSSValue( | 16 CSSTransformComponent* CSSTransformComponent::fromCSSValue( |
| 17 const CSSValue& value) { | 17 const CSSValue& value) { |
| 18 if (!value.isFunctionValue()) | 18 if (!value.isFunctionValue()) |
| 19 return nullptr; | 19 return nullptr; |
| 20 | 20 |
| 21 const CSSFunctionValue& functionValue = toCSSFunctionValue(value); | 21 const CSSFunctionValue& functionValue = toCSSFunctionValue(value); |
| 22 switch (functionValue.functionType()) { | 22 switch (functionValue.functionType()) { |
| 23 case CSSValueMatrix: | 23 case CSSValueMatrix: |
| 24 case CSSValueMatrix3d: | 24 case CSSValueMatrix3d: |
| 25 return CSSMatrixTransformComponent::fromCSSValue(functionValue); | 25 return CSSMatrixComponent::fromCSSValue(functionValue); |
| 26 case CSSValuePerspective: | 26 case CSSValuePerspective: |
| 27 return CSSPerspective::fromCSSValue(functionValue); | 27 return CSSPerspective::fromCSSValue(functionValue); |
| 28 case CSSValueRotate: | 28 case CSSValueRotate: |
| 29 case CSSValueRotateX: | 29 case CSSValueRotateX: |
| 30 case CSSValueRotateY: | 30 case CSSValueRotateY: |
| 31 case CSSValueRotateZ: | 31 case CSSValueRotateZ: |
| 32 case CSSValueRotate3d: | 32 case CSSValueRotate3d: |
| 33 return CSSRotation::fromCSSValue(functionValue); | 33 return CSSRotation::fromCSSValue(functionValue); |
| 34 case CSSValueScale: | 34 case CSSValueScale: |
| 35 case CSSValueScaleX: | 35 case CSSValueScaleX: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 46 case CSSValueTranslateY: | 46 case CSSValueTranslateY: |
| 47 case CSSValueTranslateZ: | 47 case CSSValueTranslateZ: |
| 48 case CSSValueTranslate3d: | 48 case CSSValueTranslate3d: |
| 49 return CSSTranslation::fromCSSValue(functionValue); | 49 return CSSTranslation::fromCSSValue(functionValue); |
| 50 default: | 50 default: |
| 51 return nullptr; | 51 return nullptr; |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 } // namespace blink | 55 } // namespace blink |
| OLD | NEW |