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

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: Almost forgot: drop unused ctor. (+ rebase). 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
« no previous file with comments | « Source/core/css/resolver/StyleBuilderCustom.cpp ('k') | Source/core/rendering/style/StyleTransformData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/RenderStyle.h
diff --git a/Source/core/rendering/style/RenderStyle.h b/Source/core/rendering/style/RenderStyle.h
index d25142d22e24d5568b04ffd10bab8491e496db14..8851b13b820dccd1d70c51b92fcf61dfec9825a1 100644
--- a/Source/core/rendering/style/RenderStyle.h
+++ b/Source/core/rendering/style/RenderStyle.h
@@ -57,6 +57,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"
@@ -862,9 +863,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; }
@@ -1342,9 +1344,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); }
@@ -1662,8 +1665,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; }
« no previous file with comments | « Source/core/css/resolver/StyleBuilderCustom.cpp ('k') | Source/core/rendering/style/StyleTransformData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698