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

Unified Diff: Source/core/style/StyleTransformData.cpp

Issue 1158603003: CSS Independent Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase master and explicit applyTransform parameters Created 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/style/StyleTransformData.cpp
diff --git a/Source/core/style/StyleTransformData.cpp b/Source/core/style/StyleTransformData.cpp
index f9f35a5780f5b2d2499175884d2824d24dfc5b6d..2882ce567dd21ef5eb45c5ea8d5da37fef3a4cb8 100644
--- a/Source/core/style/StyleTransformData.cpp
+++ b/Source/core/style/StyleTransformData.cpp
@@ -23,6 +23,7 @@
#include "core/style/StyleTransformData.h"
#include "core/style/ComputedStyle.h"
+#include "core/style/DataEquivalency.h"
namespace blink {
@@ -38,12 +39,28 @@ StyleTransformData::StyleTransformData(const StyleTransformData& o)
, m_operations(o.m_operations)
, m_origin(o.m_origin)
, m_motion(o.m_motion)
+ , m_translate(o.m_translate)
+ , m_rotate(o.m_rotate)
+ , m_scale(o.m_scale)
{
}
bool StyleTransformData::operator==(const StyleTransformData& o) const
{
- return m_origin == o.m_origin && m_operations == o.m_operations && m_motion == o.m_motion;
+ return m_origin == o.m_origin
+ && m_operations == o.m_operations
+ && m_motion == o.m_motion
+ && dataEquivalent<TransformOperation>(m_translate, o.m_translate)
+ && dataEquivalent<TransformOperation>(m_rotate, o.m_rotate)
+ && dataEquivalent<TransformOperation>(m_scale, o.m_scale);
+}
+
+bool StyleTransformData::has3DTransform() const
+{
+ return m_operations.has3DOperation()
+ || (m_translate && m_translate->z() != 0)
+ || (m_rotate && (m_rotate->x() != 0 || m_rotate->y() != 0))
+ || (m_scale && m_scale->z() != 1);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698