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 CSSTranslation_h | 5 #ifndef CSSTranslation_h |
6 #define CSSTranslation_h | 6 #define CSSTranslation_h |
7 | 7 |
8 #include "core/css/cssom/CSSLengthValue.h" | 8 #include "core/css/cssom/CSSLengthValue.h" |
9 #include "core/css/cssom/TransformComponent.h" | 9 #include "core/css/cssom/TransformComponent.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class ExceptionState; | 13 class ExceptionState; |
14 | 14 |
15 class CORE_EXPORT CSSTranslation final : public TransformComponent { | 15 class CORE_EXPORT CSSTranslation final : public TransformComponent { |
16 WTF_MAKE_NONCOPYABLE(CSSTranslation); | 16 WTF_MAKE_NONCOPYABLE(CSSTranslation); |
17 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
18 public: | 18 public: |
19 static CSSTranslation* create(CSSLengthValue* x, CSSLengthValue* y, Exceptio
nState&) | 19 static CSSTranslation* create(CSSLengthValue* x, CSSLengthValue* y, Exceptio
nState&) |
20 { | 20 { |
| 21 return CSSTranslation::create(x, y); |
| 22 } |
| 23 static CSSTranslation* create(CSSLengthValue* x, CSSLengthValue* y) |
| 24 { |
21 return new CSSTranslation(x, y, nullptr); | 25 return new CSSTranslation(x, y, nullptr); |
22 } | 26 } |
23 static CSSTranslation* create(CSSLengthValue* x, CSSLengthValue* y, CSSLengt
hValue* z, ExceptionState&); | 27 static CSSTranslation* create(CSSLengthValue* x, CSSLengthValue* y, CSSLengt
hValue* z, ExceptionState&); |
24 | 28 |
25 static CSSTranslation* fromCSSValue(const CSSValue& value) { return nullptr;
} | 29 static CSSTranslation* fromCSSValue(const CSSValue& value); |
26 | 30 |
27 CSSLengthValue* x() const { return m_x; } | 31 CSSLengthValue* x() const { return m_x; } |
28 CSSLengthValue* y() const { return m_y; } | 32 CSSLengthValue* y() const { return m_y; } |
29 CSSLengthValue* z() const { return m_z; } | 33 CSSLengthValue* z() const { return m_z; } |
30 | 34 |
31 TransformComponentType type() const override { return is2D() ? TranslationTy
pe : Translation3DType; } | 35 TransformComponentType type() const override { return is2D() ? TranslationTy
pe : Translation3DType; } |
32 | 36 |
33 // TODO: Implement asMatrix for CSSTranslation. | 37 // TODO: Implement asMatrix for CSSTranslation. |
34 CSSMatrixTransformComponent* asMatrix() const override { return nullptr; } | 38 CSSMatrixTransformComponent* asMatrix() const override { return nullptr; } |
35 | 39 |
(...skipping 18 matching lines...) Expand all Loading... |
54 bool is2D() const { return !m_z; } | 58 bool is2D() const { return !m_z; } |
55 | 59 |
56 Member<CSSLengthValue> m_x; | 60 Member<CSSLengthValue> m_x; |
57 Member<CSSLengthValue> m_y; | 61 Member<CSSLengthValue> m_y; |
58 Member<CSSLengthValue> m_z; | 62 Member<CSSLengthValue> m_z; |
59 }; | 63 }; |
60 | 64 |
61 } // namespace blink | 65 } // namespace blink |
62 | 66 |
63 #endif | 67 #endif |
OLD | NEW |