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

Unified Diff: Source/core/style/ComputedStyle.h

Issue 1158603003: CSS Independent Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/ComputedStyle.h
diff --git a/Source/core/style/ComputedStyle.h b/Source/core/style/ComputedStyle.h
index 64abb5eb0ef055f4949c15f8119748e51432bb07..b72b2215c567392ffc08d3591683f2d722310b2d 100644
--- a/Source/core/style/ComputedStyle.h
+++ b/Source/core/style/ComputedStyle.h
@@ -75,7 +75,10 @@
#include "platform/scroll/ScrollableArea.h"
#include "platform/text/TextDirection.h"
#include "platform/text/UnicodeBidi.h"
+#include "platform/transforms/RotateTransformOperation.h"
+#include "platform/transforms/ScaleTransformOperation.h"
#include "platform/transforms/TransformOperations.h"
+#include "platform/transforms/TranslateTransformOperation.h"
#include "public/platform/WebScrollBlocksOn.h"
#include "wtf/Forward.h"
#include "wtf/OwnPtr.h"
@@ -842,8 +845,16 @@ public:
const TransformOrigin& transformOrigin() const { return rareNonInheritedData->m_transform->m_origin; }
const Length& transformOriginX() const { return transformOrigin().x(); }
const Length& transformOriginY() const { return transformOrigin().y(); }
+ const PassRefPtr<TranslateTransformOperation> translate() const { return rareNonInheritedData->m_transform->m_translate; }
Timothy Loh 2015/06/05 00:55:59 Maybe just return TranslateTransformOperation*
soonm 2015/06/10 04:09:32 Done.
+ const PassRefPtr<RotateTransformOperation> rotate() const { return rareNonInheritedData->m_transform->m_rotate; }
+ const PassRefPtr<ScaleTransformOperation> scale() const { return rareNonInheritedData->m_transform->m_scale; }
float transformOriginZ() const { return transformOrigin().z(); }
- bool hasTransform() const { return hasTransformOperations() || hasMotionPath() || hasCurrentTransformAnimation(); }
+ bool hasTranslateProperty() const { return rareNonInheritedData->m_transform->m_translate; }
+ bool hasRotateProperty() const { return rareNonInheritedData->m_transform->m_rotate; }
+ bool hasScaleProperty() const { return rareNonInheritedData->m_transform->m_scale; }
+ bool has3DTransformProperties() const { return rareNonInheritedData->m_transform->has3DTransformProperties(); }
+ bool hasTransformProperties() const { return hasTranslateProperty() || hasRotateProperty() || hasScaleProperty(); }
+ bool hasTransform() const { return hasTransformOperations() || hasMotionPath() || hasCurrentTransformAnimation() || hasTransformProperties(); }
bool transformDataEquivalent(const ComputedStyle& otherStyle) const { return rareNonInheritedData->m_transform == otherStyle.rareNonInheritedData->m_transform; }
StyleMotionPath* motionPath() const { return rareNonInheritedData->m_transform->m_motion.m_path.get(); }
@@ -871,8 +882,9 @@ public:
enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
enum ApplyMotionPath { IncludeMotionPath, ExcludeMotionPath };
- void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin, ApplyMotionPath = IncludeMotionPath) const;
- void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, ApplyTransformOrigin = IncludeTransformOrigin, ApplyMotionPath = IncludeMotionPath) const;
+ enum ApplyTransformProperty { IncludeTransformProperty, ExcludeTransformProperty };
+ void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin, ApplyMotionPath = IncludeMotionPath, ApplyTransformProperty = IncludeTransformProperty) const;
+ void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, ApplyTransformOrigin = IncludeTransformOrigin, ApplyMotionPath = IncludeMotionPath, ApplyTransformProperty = IncludeTransformProperty) const;
bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
@@ -1315,6 +1327,13 @@ public:
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 setTranslate(PassRefPtr<TranslateTransformOperation> v) { rareNonInheritedData.access()->m_transform.access()->setTranslate(v); }
+ void setTranslate(const Length& tx, const Length& ty, const double& tz) { rareNonInheritedData.access()->m_transform.access()->setTranslate(tx, ty, tz); }
+ void setRotate(PassRefPtr<RotateTransformOperation> v) { rareNonInheritedData.access()->m_transform.access()->setRotate(v); }
+ void setRotate(const double& angle, const double& x, const double& y, const double& z) { rareNonInheritedData.access()->m_transform.access()->setRotate(angle, x, y, z); }
+ void setScale(PassRefPtr<ScaleTransformOperation> v) { rareNonInheritedData.access()->m_transform.access()->setScale(v); }
+ void setScale(const double& sx, const double& sy, const double& sz) { rareNonInheritedData.access()->m_transform.access()->setScale(sx, sy, sz); }
+
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); }
@@ -1776,6 +1795,8 @@ private:
bool diffNeedsPaintInvalidationLayer(const ComputedStyle& other) const;
bool diffNeedsPaintInvalidationObject(const ComputedStyle& other) const;
void updatePropertySpecificDifferences(const ComputedStyle& other, StyleDifference&) const;
+
+ bool requireTransformOrigin(ApplyTransformOrigin applyOrigin, ApplyMotionPath) const;
};
// FIXME: Reduce/remove the dependency on zoom adjusted int values.

Powered by Google App Engine
This is Rietveld 408576698