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/CSSNumericValue.h" | 9 #include "core/css/cssom/CSSNumericValue.h" |
10 #include "core/css/cssom/CSSTransformComponent.h" | 10 #include "core/css/cssom/CSSTransformComponent.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // Constructor defined in the IDL. | 25 // Constructor defined in the IDL. |
26 static CSSPerspective* Create(CSSNumericValue*, ExceptionState&); | 26 static CSSPerspective* Create(CSSNumericValue*, ExceptionState&); |
27 | 27 |
28 // Blink-internal ways of creating CSSPerspectives. | 28 // Blink-internal ways of creating CSSPerspectives. |
29 static CSSPerspective* FromCSSValue(const CSSFunctionValue&); | 29 static CSSPerspective* FromCSSValue(const CSSFunctionValue&); |
30 | 30 |
31 // Getters and setters for attributes defined in the IDL. | 31 // Getters and setters for attributes defined in the IDL. |
32 CSSNumericValue* length() { return length_.Get(); } | 32 CSSNumericValue* length() { return length_.Get(); } |
33 void setLength(CSSNumericValue*, ExceptionState&); | 33 void setLength(CSSNumericValue*, ExceptionState&); |
34 | 34 |
| 35 // From CSSTransformComponent |
| 36 // Setting is2D for CSSPerspective does nothing. |
| 37 // https://drafts.css-houdini.org/css-typed-om/#dom-cssskew-is2d |
| 38 void setIs2D(bool is2D) final {} |
| 39 |
35 // Internal methods - from CSSTransformComponent. | 40 // Internal methods - from CSSTransformComponent. |
36 TransformComponentType GetType() const final { return kPerspectiveType; } | 41 TransformComponentType GetType() const final { return kPerspectiveType; } |
37 // TODO: Implement AsMatrix for CSSPerspective. | 42 // TODO: Implement AsMatrix for CSSPerspective. |
38 DOMMatrix* AsMatrix() const final { return nullptr; } | 43 DOMMatrix* AsMatrix() const final { return nullptr; } |
39 CSSFunctionValue* ToCSSValue() const final; | 44 CSSFunctionValue* ToCSSValue() const final; |
40 | 45 |
41 DEFINE_INLINE_VIRTUAL_TRACE() { | 46 DEFINE_INLINE_VIRTUAL_TRACE() { |
42 visitor->Trace(length_); | 47 visitor->Trace(length_); |
43 CSSTransformComponent::Trace(visitor); | 48 CSSTransformComponent::Trace(visitor); |
44 } | 49 } |
45 | 50 |
46 private: | 51 private: |
47 CSSPerspective(CSSNumericValue* length) : length_(length) {} | 52 CSSPerspective(CSSNumericValue* length) |
| 53 : CSSTransformComponent(false /* is2D */), length_(length) {} |
48 | 54 |
49 Member<CSSNumericValue> length_; | 55 Member<CSSNumericValue> length_; |
50 }; | 56 }; |
51 | 57 |
52 } // namespace blink | 58 } // namespace blink |
53 | 59 |
54 #endif | 60 #endif |
OLD | NEW |