Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp |
index ffed0927bdf87288d605175702123a1bf8c41066..985e24341a7708b8222685c15c214f14c0c63eaa 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp |
@@ -151,12 +151,17 @@ void LayoutSVGRoot::layout() |
SVGSVGElement* svg = toSVGSVGElement(node()); |
ASSERT(svg); |
m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size()); |
+ // When hasRelativeLengths() is false, no descendants have relative lengths |
+ // (hence no one is interested in viewport size changes). |
+ bool layoutSizeChanged = m_isLayoutSizeChanged && svg->hasRelativeLengths(); |
+ |
// If any of this root's children need to be laid out, and a filter is |
// applied to it, we need to issue paint invalidations for all descendants. |
bool forceLayoutOfChildren = needsLayout |
|| (normalChildNeedsLayout() && SVGLayoutSupport::hasFilterResource(*this)); |
+ |
const bool transformToRootChanged = false; |
- SVGLayoutSupport::layoutChildren(this, forceLayoutOfChildren, transformToRootChanged); |
+ SVGLayoutSupport::layoutChildren(this, forceLayoutOfChildren, transformToRootChanged, layoutSizeChanged); |
if (m_needsBoundariesOrTransformUpdate) { |
updateCachedBoundaries(); |