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

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

Issue 2514043002: [CSS Typed OM] Add CSSValue->CSSSkew conversions (Closed)
Patch Set: Merge branch 'update-transform-tests' into cssskew-fromcssvalue-2 Created 4 years 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 CSSSkew_h 5 #ifndef CSSSkew_h
6 #define CSSSkew_h 6 #define CSSSkew_h
7 7
8 #include "core/css/cssom/CSSAngleValue.h" 8 #include "core/css/cssom/CSSAngleValue.h"
9 #include "core/css/cssom/CSSMatrixTransformComponent.h" 9 #include "core/css/cssom/CSSMatrixTransformComponent.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 CORE_EXPORT CSSSkew final : public CSSTransformComponent { 14 class CORE_EXPORT CSSSkew final : public CSSTransformComponent {
15 WTF_MAKE_NONCOPYABLE(CSSSkew); 15 WTF_MAKE_NONCOPYABLE(CSSSkew);
16 DEFINE_WRAPPERTYPEINFO(); 16 DEFINE_WRAPPERTYPEINFO();
17 17
18 public: 18 public:
19 static CSSSkew* create(const CSSAngleValue* ax, const CSSAngleValue* ay) { 19 static CSSSkew* create(const CSSAngleValue* ax, const CSSAngleValue* ay) {
20 return new CSSSkew(ax, ay); 20 return new CSSSkew(ax, ay);
21 } 21 }
22 22
23 static CSSSkew* fromCSSValue(const CSSFunctionValue& value) { 23 static CSSSkew* fromCSSValue(const CSSFunctionValue&);
24 return nullptr;
25 }
26 24
27 // Bindings requires returning non-const pointers. This is safe because 25 // Bindings requires returning non-const pointers. This is safe because
28 // CSSAngleValues are immutable. 26 // CSSAngleValues are immutable.
29 CSSAngleValue* ax() const { return const_cast<CSSAngleValue*>(m_ax.get()); } 27 CSSAngleValue* ax() const { return const_cast<CSSAngleValue*>(m_ax.get()); }
30 CSSAngleValue* ay() const { return const_cast<CSSAngleValue*>(m_ay.get()); } 28 CSSAngleValue* ay() const { return const_cast<CSSAngleValue*>(m_ay.get()); }
31 29
32 TransformComponentType type() const override { return SkewType; } 30 TransformComponentType type() const override { return SkewType; }
33 31
34 CSSMatrixTransformComponent* asMatrix() const override { 32 CSSMatrixTransformComponent* asMatrix() const override {
35 return CSSMatrixTransformComponent::skew(m_ax->degrees(), m_ay->degrees()); 33 return CSSMatrixTransformComponent::skew(m_ax->degrees(), m_ay->degrees());
(...skipping 11 matching lines...) Expand all
47 CSSSkew(const CSSAngleValue* ax, const CSSAngleValue* ay) 45 CSSSkew(const CSSAngleValue* ax, const CSSAngleValue* ay)
48 : CSSTransformComponent(), m_ax(ax), m_ay(ay) {} 46 : CSSTransformComponent(), m_ax(ax), m_ay(ay) {}
49 47
50 Member<const CSSAngleValue> m_ax; 48 Member<const CSSAngleValue> m_ax;
51 Member<const CSSAngleValue> m_ay; 49 Member<const CSSAngleValue> m_ay;
52 }; 50 };
53 51
54 } // namespace blink 52 } // namespace blink
55 53
56 #endif 54 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp ('k') | third_party/WebKit/Source/core/css/cssom/CSSSkew.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698