Index: Source/core/rendering/svg/SVGRenderSupport.cpp |
diff --git a/Source/core/rendering/svg/SVGRenderSupport.cpp b/Source/core/rendering/svg/SVGRenderSupport.cpp |
index f0a9cee861f40d10acd9c1ed29debfaf0265d3b3..397b16c5542c88546e3edd278f3308131f557b5e 100644 |
--- a/Source/core/rendering/svg/SVGRenderSupport.cpp |
+++ b/Source/core/rendering/svg/SVGRenderSupport.cpp |
@@ -56,6 +56,21 @@ LayoutRect SVGRenderSupport::clippedOverflowRectForPaintInvalidation(const Rende |
FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordinates(); |
paintInvalidationRect.inflate(object->style()->outlineWidth()); |
+ if (paintInvalidationState && paintInvalidationState->canMapToContainer(paintInvalidationContainer)) { |
+ // Compute accumulated SVG transform and apply to local paint rect. |
+ AffineTransform transform = paintInvalidationState->svgTransform() * object->localToParentTransform(); |
+ paintInvalidationRect = transform.mapRect(paintInvalidationRect); |
+ // FIXME: These are quirks carried forward from RenderSVGRoot::computeFloatRectForPaintInvalidation. |
+ LayoutRect rect; |
+ if (!paintInvalidationRect.isEmpty()) |
+ rect = enclosingIntRect(paintInvalidationRect); |
+ // Offset by SVG root paint offset and apply clipping as needed. |
+ rect.move(paintInvalidationState->paintOffset()); |
+ if (paintInvalidationState->isClipped()) |
+ rect.intersect(paintInvalidationState->clipRect()); |
+ return rect; |
+ } |
+ |
object->computeFloatRectForPaintInvalidation(paintInvalidationContainer, paintInvalidationRect, paintInvalidationState); |
return enclosingLayoutRect(paintInvalidationRect); |
} |
@@ -71,6 +86,13 @@ void SVGRenderSupport::mapLocalToContainer(const RenderObject* object, const Ren |
{ |
transformState.applyTransform(object->localToParentTransform()); |
+ if (paintInvalidationState && paintInvalidationState->canMapToContainer(paintInvalidationContainer)) { |
+ // |svgTransform| contains localToBorderBoxTransform mentioned below. |
+ transformState.applyTransform(paintInvalidationState->svgTransform()); |
+ transformState.move(paintInvalidationState->paintOffset()); |
+ return; |
+ } |
+ |
RenderObject* parent = object->parent(); |
// At the SVG/HTML boundary (aka RenderSVGRoot), we apply the localToBorderBoxTransform |