| Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGTransformableContainer.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGTransformableContainer.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGTransformableContainer.cpp
|
| index e27c088da31d36a9f684c06e4d686ed8ec29f84d..3c7b70ca1ad1194c04ae01d532c56181c2212d12 100644
|
| --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGTransformableContainer.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGTransformableContainer.cpp
|
| @@ -66,7 +66,18 @@ bool LayoutSVGTransformableContainer::isChildAllowed(LayoutObject* child, const
|
| return LayoutSVGContainer::isChildAllowed(child, style);
|
| }
|
|
|
| -bool LayoutSVGTransformableContainer::calculateLocalTransform()
|
| +void LayoutSVGTransformableContainer::setNeedsTransformUpdate()
|
| +{
|
| + setMayNeedPaintInvalidationSubtree();
|
| + m_needsTransformUpdate = true;
|
| +}
|
| +
|
| +static std::pair<double, double> scaleReference(const AffineTransform& transform)
|
| +{
|
| + return std::make_pair(transform.xScaleSquared(), transform.yScaleSquared());
|
| +}
|
| +
|
| +LayoutSVGContainer::TransformChange LayoutSVGTransformableContainer::calculateLocalTransform()
|
| {
|
| SVGGraphicsElement* element = toSVGGraphicsElement(this->element());
|
| ASSERT(element);
|
| @@ -88,18 +99,23 @@ bool LayoutSVGTransformableContainer::calculateLocalTransform()
|
| FloatSize translation(
|
| useElement->x()->currentValue()->value(lengthContext),
|
| useElement->y()->currentValue()->value(lengthContext));
|
| + // TODO(fs): Signal this on style update instead. (Since these are
|
| + // suppose to be presentation attributes now, this does feel a bit
|
| + // broken...)
|
| if (translation != m_additionalTranslation)
|
| - m_needsTransformUpdate = true;
|
| + setNeedsTransformUpdate();
|
| m_additionalTranslation = translation;
|
| }
|
|
|
| if (!m_needsTransformUpdate)
|
| - return false;
|
| + return TransformChange::None;
|
|
|
| + std::pair<double, double> oldScale = scaleReference(m_localTransform);
|
| m_localTransform = element->calculateAnimatedLocalTransform();
|
| m_localTransform.translate(m_additionalTranslation.width(), m_additionalTranslation.height());
|
| m_needsTransformUpdate = false;
|
| - return true;
|
| + return scaleReference(m_localTransform) != oldScale
|
| + ? TransformChange::Full : TransformChange::ScaleInvariant;
|
| }
|
|
|
| } // namespace blink
|
|
|