| Index: Source/core/style/ComputedStyle.cpp
|
| diff --git a/Source/core/style/ComputedStyle.cpp b/Source/core/style/ComputedStyle.cpp
|
| index c01ddf928a2c652f6b556d64357ec39ae634dc64..0bbf31d972d9095f491f9eefc2d3204f1ecbd284 100644
|
| --- a/Source/core/style/ComputedStyle.cpp
|
| +++ b/Source/core/style/ComputedStyle.cpp
|
| @@ -882,15 +882,17 @@ bool ComputedStyle::hasWillChangeCompositingHint() const
|
| return false;
|
| }
|
|
|
| -inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation>>& transformOperations, ComputedStyle::ApplyTransformOrigin applyOrigin, ComputedStyle::ApplyMotionPath applyMotionPath)
|
| +bool ComputedStyle::requireTransformOrigin(ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionPath) const
|
| {
|
| + const Vector<RefPtr<TransformOperation>>& transformOperations = rareNonInheritedData->m_transform->m_operations.operations();
|
| +
|
| // transform-origin brackets the transform with translate operations.
|
| // Optimize for the case where the only transform is a translation, since the transform-origin is irrelevant
|
| // in that case.
|
| - if (applyOrigin != ComputedStyle::IncludeTransformOrigin)
|
| + if (applyOrigin != IncludeTransformOrigin)
|
| return false;
|
|
|
| - if (applyMotionPath == ComputedStyle::IncludeMotionPath)
|
| + if (applyMotionPath == IncludeMotionPath)
|
| return true;
|
|
|
| unsigned size = transformOperations.size();
|
| @@ -904,20 +906,23 @@ inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation>>& tra
|
| return true;
|
| }
|
|
|
| + if (hasScaleProperty() || hasRotateProperty())
|
| + return true;
|
| +
|
| return false;
|
| }
|
|
|
| -void ComputedStyle::applyTransform(TransformationMatrix& transform, const LayoutSize& borderBoxSize, ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionPath) const
|
| +void ComputedStyle::applyTransform(TransformationMatrix& transform, const LayoutSize& borderBoxSize, ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionPath, ApplyTransformProperty applyTransformProperty) const
|
| {
|
| - applyTransform(transform, FloatRect(FloatPoint(), FloatSize(borderBoxSize)), applyOrigin, applyMotionPath);
|
| + applyTransform(transform, FloatRect(FloatPoint(), FloatSize(borderBoxSize)), applyOrigin, applyMotionPath, applyTransformProperty);
|
| }
|
|
|
| -void ComputedStyle::applyTransform(TransformationMatrix& transform, const FloatRect& boundingBox, ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionPath) const
|
| +void ComputedStyle::applyTransform(TransformationMatrix& transform, const FloatRect& boundingBox, ApplyTransformOrigin applyOrigin, ApplyMotionPath applyMotionPath, ApplyTransformProperty applyTransformProperty) const
|
| {
|
| if (!hasMotionPath())
|
| applyMotionPath = ExcludeMotionPath;
|
| const Vector<RefPtr<TransformOperation>>& transformOperations = rareNonInheritedData->m_transform->m_operations.operations();
|
| - bool applyTransformOrigin = requireTransformOrigin(transformOperations, applyOrigin, applyMotionPath);
|
| + bool applyTransformOrigin = requireTransformOrigin(applyOrigin, applyMotionPath);
|
|
|
| float offsetX = transformOriginX().type() == Percent ? boundingBox.x() : 0;
|
| float offsetY = transformOriginY().type() == Percent ? boundingBox.y() : 0;
|
| @@ -928,6 +933,23 @@ void ComputedStyle::applyTransform(TransformationMatrix& transform, const FloatR
|
| transformOriginZ());
|
| }
|
|
|
| + if (applyTransformProperty == IncludeTransformProperty) {
|
| + if (hasTranslateProperty()) {
|
| + RefPtr<TransformOperation> translateOp = translate();
|
| + translateOp->apply(transform, boundingBox.size());
|
| + }
|
| +
|
| + if (hasRotateProperty()) {
|
| + RefPtr<TransformOperation> rotateOp = rotate();
|
| + rotateOp->apply(transform, boundingBox.size());
|
| + }
|
| +
|
| + if (hasScaleProperty()) {
|
| + RefPtr<TransformOperation> scaleOp = scale();
|
| + scaleOp->apply(transform, boundingBox.size());
|
| + }
|
| + }
|
| +
|
| if (applyMotionPath == ComputedStyle::IncludeMotionPath)
|
| applyMotionPathTransform(transform);
|
|
|
|
|