Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/CSSTranslation.h

Issue 1958933003: Typed CSSOM: Rename Translation to CSSTranslation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 TranslationTransformComponent_h 5 #ifndef CSSTranslation_h
6 #define TranslationTransformComponent_h 6 #define CSSTranslation_h
7 7
8 #include "core/css/cssom/LengthValue.h" 8 #include "core/css/cssom/LengthValue.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 TranslationTransformComponent final : public TransformComponen t { 15 class CORE_EXPORT CSSTranslation final : public TransformComponent {
16 WTF_MAKE_NONCOPYABLE(TranslationTransformComponent); 16 WTF_MAKE_NONCOPYABLE(CSSTranslation);
17 DEFINE_WRAPPERTYPEINFO(); 17 DEFINE_WRAPPERTYPEINFO();
18 public: 18 public:
19 static TranslationTransformComponent* create(LengthValue* x, LengthValue* y, ExceptionState&) 19 static CSSTranslation* create(LengthValue* x, LengthValue* y, ExceptionState &)
20 { 20 {
21 return new TranslationTransformComponent(x, y, nullptr); 21 return new CSSTranslation(x, y, nullptr);
22 } 22 }
23 static TranslationTransformComponent* create(LengthValue* x, LengthValue* y, LengthValue* z, ExceptionState&); 23 static CSSTranslation* create(LengthValue* x, LengthValue* y, LengthValue* z , ExceptionState&);
24 24
25 LengthValue* x() const { return m_x; } 25 LengthValue* x() const { return m_x; }
26 LengthValue* y() const { return m_y; } 26 LengthValue* y() const { return m_y; }
27 LengthValue* z() const { return m_z; } 27 LengthValue* z() const { return m_z; }
28 28
29 TransformComponentType type() const override { return is2D() ? TranslationTy pe : Translation3DType; } 29 TransformComponentType type() const override { return is2D() ? TranslationTy pe : Translation3DType; }
30 30
31 // TODO: Implement asMatrix for TranslationTransformComponent. 31 // TODO: Implement asMatrix for CSSTranslation.
32 MatrixTransformComponent* asMatrix() const override { return nullptr; } 32 MatrixTransformComponent* 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 { 37 {
38 visitor->trace(m_x); 38 visitor->trace(m_x);
39 visitor->trace(m_y); 39 visitor->trace(m_y);
40 visitor->trace(m_z); 40 visitor->trace(m_z);
41 TransformComponent::trace(visitor); 41 TransformComponent::trace(visitor);
42 } 42 }
43 43
44 private: 44 private:
45 TranslationTransformComponent(LengthValue* x, LengthValue* y, LengthValue* z ) 45 CSSTranslation(LengthValue* x, LengthValue* y, LengthValue* z)
46 : TransformComponent() 46 : TransformComponent()
47 , m_x(x) 47 , m_x(x)
48 , m_y(y) 48 , m_y(y)
49 , m_z(z) 49 , m_z(z)
50 { } 50 { }
51 51
52 bool is2D() const { return !m_z; } 52 bool is2D() const { return !m_z; }
53 53
54 Member<LengthValue> m_x; 54 Member<LengthValue> m_x;
55 Member<LengthValue> m_y; 55 Member<LengthValue> m_y;
56 Member<LengthValue> m_z; 56 Member<LengthValue> m_z;
57 }; 57 };
58 58
59 } // namespace blink 59 } // namespace blink
60 60
61 #endif 61 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698