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

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

Issue 2047923002: [WIP] Add support for CSSValue-> CSSLengthValue and CSSTranslation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@supported-types
Patch Set: Created 4 years, 6 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 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698