Index: Source/core/rendering/svg/SVGRenderSupport.cpp |
diff --git a/Source/core/rendering/svg/SVGRenderSupport.cpp b/Source/core/rendering/svg/SVGRenderSupport.cpp |
index 6f7103f84309de0f7c6e8de99b2215518e8f3806..38ce60e8690ccc10af99ec57967652a19b5a75c2 100644 |
--- a/Source/core/rendering/svg/SVGRenderSupport.cpp |
+++ b/Source/core/rendering/svg/SVGRenderSupport.cpp |
@@ -62,6 +62,22 @@ void SVGRenderSupport::computeFloatRectForPaintInvalidation(const RenderObject* |
{ |
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()); |
+ paintInvalidationRect = rect; |
+ return; |
+ } |
+ |
// Translate to coords in our parent renderer, and then call computeFloatRectForPaintInvalidation() on our parent. |
paintInvalidationRect = object->localToParentTransform().mapRect(paintInvalidationRect); |
object->parent()->computeFloatRectForPaintInvalidation(paintInvalidationContainer, paintInvalidationRect, paintInvalidationState); |
@@ -71,6 +87,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 |