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 CSSPerspective_h | 5 #ifndef CSSPerspective_h |
6 #define CSSPerspective_h | 6 #define CSSPerspective_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/css/cssom/CSSLengthValue.h" | 9 #include "core/css/cssom/CSSNumericValue.h" |
10 #include "core/css/cssom/CSSTransformComponent.h" | 10 #include "core/css/cssom/CSSTransformComponent.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class ExceptionState; | 14 class ExceptionState; |
15 | 15 |
16 class CORE_EXPORT CSSPerspective : public CSSTransformComponent { | 16 class CORE_EXPORT CSSPerspective : public CSSTransformComponent { |
17 WTF_MAKE_NONCOPYABLE(CSSPerspective); | 17 WTF_MAKE_NONCOPYABLE(CSSPerspective); |
18 DEFINE_WRAPPERTYPEINFO(); | 18 DEFINE_WRAPPERTYPEINFO(); |
19 | 19 |
20 public: | 20 public: |
21 static CSSPerspective* Create(const CSSLengthValue*, ExceptionState&); | 21 static CSSPerspective* Create(const CSSNumericValue*, ExceptionState&); |
22 static CSSPerspective* FromCSSValue(const CSSFunctionValue&); | 22 static CSSPerspective* FromCSSValue(const CSSFunctionValue&); |
23 | 23 |
24 // Bindings require a non const return value. | 24 // Bindings require a non const return value. |
25 CSSLengthValue* length() const { | 25 CSSNumericValue* length() const { |
26 return const_cast<CSSLengthValue*>(length_.Get()); | 26 return const_cast<CSSNumericValue*>(length_.Get()); |
27 } | 27 } |
28 | 28 |
29 TransformComponentType GetType() const override { return kPerspectiveType; } | 29 TransformComponentType GetType() const override { return kPerspectiveType; } |
30 | 30 |
31 // TODO: Implement asMatrix for CSSPerspective. | 31 // TODO: Implement asMatrix for CSSPerspective. |
32 CSSMatrixComponent* asMatrix() const override { return nullptr; } | 32 CSSMatrixComponent* asMatrix() const override { return nullptr; } |
33 | 33 |
34 CSSFunctionValue* ToCSSValue() const override; | 34 CSSFunctionValue* ToCSSValue() const override; |
35 | 35 |
36 DEFINE_INLINE_VIRTUAL_TRACE() { | 36 DEFINE_INLINE_VIRTUAL_TRACE() { |
37 visitor->Trace(length_); | 37 visitor->Trace(length_); |
38 CSSTransformComponent::Trace(visitor); | 38 CSSTransformComponent::Trace(visitor); |
39 } | 39 } |
40 | 40 |
41 private: | 41 private: |
42 CSSPerspective(const CSSLengthValue* length) : length_(length) {} | 42 CSSPerspective(const CSSNumericValue* length) : length_(length) {} |
43 | 43 |
44 Member<const CSSLengthValue> length_; | 44 Member<const CSSNumericValue> length_; |
45 }; | 45 }; |
46 | 46 |
47 } // namespace blink | 47 } // namespace blink |
48 | 48 |
49 #endif | 49 #endif |
OLD | NEW |