 Chromium Code Reviews
 Chromium Code Reviews Issue 1158603003:
  CSS Independent Transform Properties  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 1158603003:
  CSS Independent Transform Properties  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| Index: Source/core/style/ComputedStyle.h | 
| diff --git a/Source/core/style/ComputedStyle.h b/Source/core/style/ComputedStyle.h | 
| index 41df5fa2f251920fc983de199397efd10ed2da93..5eff360553bd1cb13a51a60325ca8015381069ec 100644 | 
| --- a/Source/core/style/ComputedStyle.h | 
| +++ b/Source/core/style/ComputedStyle.h | 
| @@ -77,7 +77,10 @@ | 
| #include "platform/text/TextDirection.h" | 
| #include "platform/text/TextRun.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" | 
| @@ -843,8 +846,15 @@ 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(); } | 
| + TranslateTransformOperation* translate() const { return rareNonInheritedData->m_transform->m_translate.get(); } | 
| + RotateTransformOperation* rotate() const { return rareNonInheritedData->m_transform->m_rotate.get(); } | 
| + ScaleTransformOperation* scale() const { return rareNonInheritedData->m_transform->m_scale.get(); } | 
| float transformOriginZ() const { return transformOrigin().z(); } | 
| - bool hasTransform() const { return hasTransformOperations() || hasMotionPath() || hasCurrentTransformAnimation(); } | 
| + bool hasTranslate() const { return rareNonInheritedData->m_transform->m_translate; } | 
| + bool hasRotate() const { return rareNonInheritedData->m_transform->m_rotate; } | 
| + bool hasScale() const { return rareNonInheritedData->m_transform->m_scale; } | 
| + bool has3DTransformProperties() const { return rareNonInheritedData->m_transform->has3DTransformProperties(); } | 
| + bool hasTransform() const { return hasTransformOperations() || hasMotionPath() || hasCurrentTransformAnimation() || hasTranslate() || hasRotate() || hasScale(); } | 
| 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(); } | 
| @@ -872,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 ApplyTransformL2 { IncludeTransformL2, ExcludeTransformL2 }; | 
| 
alancutter (OOO until 2018)
2015/06/17 07:38:33
ApplyIndependentTransformProperties for consistenc
 
soonm
2015/06/17 23:56:53
Done.
 | 
| + void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin, ApplyMotionPath = IncludeMotionPath, ApplyTransformL2 = IncludeTransformL2) const; | 
| + void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, ApplyTransformOrigin = IncludeTransformOrigin, ApplyMotionPath = IncludeMotionPath, ApplyTransformL2 = IncludeTransformL2) const; | 
| bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); } | 
| @@ -1338,6 +1349,10 @@ 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()->m_translate = v; } | 
| + void setRotate(PassRefPtr<RotateTransformOperation> v) { rareNonInheritedData.access()->m_transform.access()->m_rotate = v; } | 
| + void setScale(PassRefPtr<ScaleTransformOperation> v) { rareNonInheritedData.access()->m_transform.access()->m_scale = v; } | 
| + | 
| 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); } | 
| @@ -1646,6 +1661,9 @@ public: | 
| static ColumnFill initialColumnFill() { return ColumnFillBalance; } | 
| static ColumnSpan initialColumnSpan() { return ColumnSpanNone; } | 
| static const TransformOperations& initialTransform() { DEFINE_STATIC_LOCAL(TransformOperations, ops, ()); return ops; } | 
| + static const PassRefPtr<TranslateTransformOperation> initialTranslate() { return TranslateTransformOperation::create(Length(0, Fixed), Length(0, Fixed), 0, TransformOperation::Translate3D); } | 
| + static const PassRefPtr<RotateTransformOperation> initialRotate() { return RotateTransformOperation::create(0, 0, 1, 0, TransformOperation::Rotate3D); } | 
| + static const PassRefPtr<ScaleTransformOperation> initialScale() { return ScaleTransformOperation::create(1, 1, 1, TransformOperation::Scale3D); } | 
| static Length initialTransformOriginX() { return Length(50.0, Percent); } | 
| static Length initialTransformOriginY() { return Length(50.0, Percent); } | 
| static float initialTransformOriginZ() { return 0; } | 
| @@ -1810,6 +1828,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. |