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 CSSTransformComponent_h | 5 #ifndef CSSTransformComponent_h |
6 #define CSSTransformComponent_h | 6 #define CSSTransformComponent_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/css/CSSFunctionValue.h" | 9 #include "core/css/CSSFunctionValue.h" |
10 #include "platform/bindings/ScriptWrappable.h" | 10 #include "platform/bindings/ScriptWrappable.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 transform_type != kScale3DType && | 43 transform_type != kScale3DType && |
44 transform_type != kTranslation3DType; | 44 transform_type != kTranslation3DType; |
45 } | 45 } |
46 | 46 |
47 virtual ~CSSTransformComponent() {} | 47 virtual ~CSSTransformComponent() {} |
48 | 48 |
49 virtual TransformComponentType GetType() const = 0; | 49 virtual TransformComponentType GetType() const = 0; |
50 | 50 |
51 bool is2D() const { return Is2DComponentType(GetType()); } | 51 bool is2D() const { return Is2DComponentType(GetType()); } |
52 | 52 |
53 String toString() const { return ToCSSValue()->CssText(); } | 53 virtual String toString() const { |
| 54 const CSSValue* result = ToCSSValue(); |
| 55 // TODO(meade): Remove this once all the number and length types are |
| 56 // rewritten. |
| 57 return result ? result->CssText() : ""; |
| 58 } |
54 | 59 |
55 virtual CSSFunctionValue* ToCSSValue() const = 0; | 60 virtual CSSFunctionValue* ToCSSValue() const = 0; |
56 virtual CSSMatrixComponent* asMatrix() const = 0; | 61 virtual CSSMatrixComponent* asMatrix() const = 0; |
57 | 62 |
58 DEFINE_INLINE_VIRTUAL_TRACE() {} | 63 DEFINE_INLINE_VIRTUAL_TRACE() {} |
59 | 64 |
60 protected: | 65 protected: |
61 CSSTransformComponent() = default; | 66 CSSTransformComponent() = default; |
62 }; | 67 }; |
63 | 68 |
64 } // namespace blink | 69 } // namespace blink |
65 | 70 |
66 #endif | 71 #endif |
OLD | NEW |