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

Unified Diff: third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.h

Issue 1589733004: CSS Typed OM: add TransformComponents Rotation and Skew (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cssValueAndCssString
Patch Set: Remove TransformComponent call in child constructor Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.h
diff --git a/third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.h b/third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.h
new file mode 100644
index 0000000000000000000000000000000000000000..2b825ed98d5df356bd1cc0dc0c941727550cdde9
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.h
@@ -0,0 +1,61 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef RotationTransformComponent_h
+#define RotationTransformComponent_h
+
+#include "core/css/cssom/TransformComponent.h"
+
+namespace blink {
+
+class CORE_EXPORT RotationTransformComponent final : public TransformComponent {
+ WTF_MAKE_NONCOPYABLE(RotationTransformComponent);
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static RotationTransformComponent* create(double angle)
+ {
+ return new RotationTransformComponent(angle);
+ }
+
+ static RotationTransformComponent* create(double angle, double x, double y, double z)
+ {
+ return new RotationTransformComponent(angle, x, y, z);
+ }
+
+ double angle() const { return m_angle; }
+ double x() const { return m_x; }
+ double y() const { return m_y; }
+ double z() const { return m_z; }
+
+ TransformComponentType type() const override { return m_is2D ? RotationType : Rotation3DType; }
+
+ PassRefPtrWillBeRawPtr<CSSFunctionValue> toCSSValue() const override;
+
+private:
+ RotationTransformComponent(double angle)
+ : m_angle(angle)
+ , m_x(0)
+ , m_y(0)
+ , m_z(1)
+ , m_is2D(true)
+ { }
+
+ RotationTransformComponent(double angle, double x, double y, double z)
+ : m_angle(angle)
+ , m_x(x)
+ , m_y(y)
+ , m_z(z)
+ , m_is2D(false)
+ { }
+
+ double m_angle;
+ double m_x;
+ double m_y;
+ double m_z;
+ bool m_is2D;
+};
+
+} // namespace blink
+
+#endif
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698