Index: Source/WebCore/rendering/svg/RenderSVGRoot.cpp |
=================================================================== |
--- Source/WebCore/rendering/svg/RenderSVGRoot.cpp (revision 112624) |
+++ Source/WebCore/rendering/svg/RenderSVGRoot.cpp (working copy) |
@@ -212,6 +212,8 @@ |
{ |
ASSERT(needsLayout()); |
+ m_resourcesNeedingToInvalidateClients.clear(); |
+ |
// Arbitrary affine transforms are incompatible with LayoutState. |
LayoutStateDisabler layoutStateDisabler(view()); |
@@ -228,6 +230,16 @@ |
SVGRenderSupport::layoutChildren(this, needsLayout || SVGRenderSupport::filtersForceContainerLayout(this)); |
m_isLayoutSizeChanged = false; |
+ if (!m_resourcesNeedingToInvalidateClients.isEmpty()) { |
+ // Invalidate resource clients, which may mark some nodes for layout. |
+ HashSet<RenderSVGResourceContainer*>::iterator end = m_resourcesNeedingToInvalidateClients.end(); |
+ for (HashSet<RenderSVGResourceContainer*>::iterator it = m_resourcesNeedingToInvalidateClients.begin(); it != end; ++it) |
+ (*it)->removeAllClientsFromCache(); |
+ |
+ m_isLayoutSizeChanged = false; |
+ SVGRenderSupport::layoutChildren(this, false); |
+ } |
+ |
// At this point LayoutRepainter already grabbed the old bounds, |
// recalculate them now so repaintAfterLayout() uses the new bounds. |
if (m_needsBoundariesOrTransformUpdate) { |
@@ -419,6 +431,16 @@ |
return svg->intrinsicHeight(SVGSVGElement::IgnoreCSSProperties).isPercent() || svg->intrinsicWidth(SVGSVGElement::IgnoreCSSProperties).isPercent(); |
} |
+void RenderSVGRoot::addResourceForClientInvalidation(RenderSVGResourceContainer* resource) |
+{ |
+ RenderObject* svgRoot = resource->parent(); |
+ while (svgRoot && !svgRoot->isSVGRoot()) |
+ svgRoot = svgRoot->parent(); |
+ if (!svgRoot) |
+ return; |
+ static_cast<RenderSVGRoot*>(svgRoot)->m_resourcesNeedingToInvalidateClients.add(resource); |
} |
+} |
+ |
#endif // ENABLE(SVG) |