diff options
Diffstat (limited to 'WebCore/rendering/RenderSVGResource.cpp')
-rw-r--r-- | WebCore/rendering/RenderSVGResource.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/WebCore/rendering/RenderSVGResource.cpp b/WebCore/rendering/RenderSVGResource.cpp index 0aa7182..b4f499e 100644 --- a/WebCore/rendering/RenderSVGResource.cpp +++ b/WebCore/rendering/RenderSVGResource.cpp @@ -184,21 +184,17 @@ RenderSVGResourceSolidColor* RenderSVGResource::sharedSolidPaintingResource() return s_sharedSolidPaintingResource; } -void RenderSVGResource::markForLayoutAndResourceInvalidation(RenderObject* object) +void RenderSVGResource::markForLayoutAndResourceInvalidation(RenderObject* object, bool needsBoundariesUpdate) { ASSERT(object); ASSERT(object->node()); ASSERT(object->node()->isSVGElement()); - // Mark the renderer for layout - object->setNeedsLayout(true); + // Eventually mark the renderer needing a boundaries update + if (needsBoundariesUpdate) + object->setNeedsBoundariesUpdate(); - // Notify any resources in the ancestor chain, that we've been invalidated - SVGElement* element = static_cast<SVGElement*>(object->node()); - if (!element->isStyled()) - return; - - static_cast<SVGStyledElement*>(element)->invalidateResourcesInAncestorChain(); + markForLayoutAndParentResourceInvalidation(object); } static inline void invalidatePaintingResource(SVGPaint* paint, RenderObject* object) @@ -254,6 +250,22 @@ void RenderSVGResource::invalidateAllResourcesOfRenderer(RenderObject* object) invalidatePaintingResource(svgStyle->strokePaint(), object); } +void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject* object, bool needsLayout) +{ + ASSERT(object); + if (needsLayout) + object->setNeedsLayout(true); + + // Invalidate resources in ancestor chain, if needed. + RenderObject* current = object->parent(); + while (current) { + if (current->isSVGResourceContainer()) + current->toRenderSVGResourceContainer()->invalidateClients(); + + current = current->parent(); + } +} + } #endif |