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

Unified Diff: Source/core/rendering/style/RenderStyle.h

Issue 644953003: Store [-webkit-]transform-origin as a TransformOrigin. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Same patch, with correct base this time. Created 6 years, 2 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/rendering/style/RenderStyle.h
diff --git a/Source/core/rendering/style/RenderStyle.h b/Source/core/rendering/style/RenderStyle.h
index 7aa6c24ad3e04a85c8a6f6b8fe993aa62000623e..6c703d0b1800a6c7ae90beae1d739d33e624aee9 100644
--- a/Source/core/rendering/style/RenderStyle.h
+++ b/Source/core/rendering/style/RenderStyle.h
@@ -58,6 +58,7 @@
#include "core/rendering/style/StyleTransformData.h"
#include "core/rendering/style/StyleVisualData.h"
#include "core/rendering/style/StyleWillChangeData.h"
+#include "core/rendering/style/TransformOrigin.h"
#include "platform/Length.h"
#include "platform/LengthBox.h"
#include "platform/LengthPoint.h"
@@ -860,9 +861,10 @@ public:
EPageBreak columnBreakAfter() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakAfter); }
bool hasInlineTransform() const { return rareNonInheritedData->m_hasInlineTransform; }
const TransformOperations& transform() const { return rareNonInheritedData->m_transform->m_operations; }
- const Length& transformOriginX() const { return rareNonInheritedData->m_transform->m_x; }
- const Length& transformOriginY() const { return rareNonInheritedData->m_transform->m_y; }
- float transformOriginZ() const { return rareNonInheritedData->m_transform->m_z; }
+ const TransformOrigin& transformOrigin() const { return rareNonInheritedData->m_transform->m_origin; }
+ const Length& transformOriginX() const { return transformOrigin().x(); }
+ const Length& transformOriginY() const { return transformOrigin().y(); }
+ float transformOriginZ() const { return transformOrigin().z(); }
bool hasTransform() const { return !rareNonInheritedData->m_transform->m_operations.operations().isEmpty(); }
bool transformDataEquivalent(const RenderStyle& otherStyle) const { return rareNonInheritedData->m_transform == otherStyle.rareNonInheritedData->m_transform; }
@@ -1339,9 +1341,10 @@ public:
void inheritColumnPropertiesFrom(RenderStyle* parent) { rareNonInheritedData.access()->m_multiCol = parent->rareNonInheritedData->m_multiCol; }
void setHasInlineTransform(bool b) { SET_VAR(rareNonInheritedData, m_hasInlineTransform, b); }
void setTransform(const TransformOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_transform, m_operations, ops); }
- void setTransformOriginX(const Length& l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_x, l); }
- void setTransformOriginY(const Length& l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_y, l); }
- void setTransformOriginZ(float f) { SET_VAR(rareNonInheritedData.access()->m_transform, m_z, f); }
+ void setTransformOriginX(const Length& v) { setTransformOrigin(TransformOrigin(v, transformOriginY(), transformOriginZ())); }
+ void setTransformOriginY(const Length& v) { setTransformOrigin(TransformOrigin(transformOriginX(), v, transformOriginZ())); }
+ void setTransformOriginZ(float f) { setTransformOrigin(TransformOrigin(transformOriginX(), transformOriginY(), f)); }
+ void setTransformOrigin(const TransformOrigin& o) { SET_VAR(rareNonInheritedData.access()->m_transform, m_origin, o); }
void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); }
void setTextCombine(TextCombine v) { SET_VAR(rareNonInheritedData, m_textCombine, v); }
void setTextDecorationColor(const StyleColor& c) { SET_VAR(rareNonInheritedData, m_textDecorationColor, c); }
@@ -1658,8 +1661,9 @@ public:
static const TransformOperations& initialTransform() { DEFINE_STATIC_LOCAL(TransformOperations, ops, ()); return ops; }
static Length initialTransformOriginX() { return Length(50.0, Percent); }
static Length initialTransformOriginY() { return Length(50.0, Percent); }
- static EPointerEvents initialPointerEvents() { return PE_AUTO; }
static float initialTransformOriginZ() { return 0; }
+ static TransformOrigin initialTransformOrigin() { return TransformOrigin(Length(50.0, Percent), Length(50.0, Percent), 0); }
+ static EPointerEvents initialPointerEvents() { return PE_AUTO; }
static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3DFlat; }
static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisibilityVisible; }
static float initialPerspective() { return 0; }

Powered by Google App Engine
This is Rietveld 408576698