Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp

Issue 1902073002: Hoist "layout size changed" check out of SVGLayoutSupport::layoutChildren (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@svg-container-layout-cleanup-2
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698