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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGHiddenContainer.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/LayoutSVGHiddenContainer.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGHiddenContainer.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGHiddenContainer.cpp
index 3961d888d0349e6063e00be58bc349481b706f29..d1979aa6d556e40dc767737975409630113c1d3a 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGHiddenContainer.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGHiddenContainer.cpp
@@ -35,7 +35,13 @@ void LayoutSVGHiddenContainer::layout()
LayoutAnalyzer::Scope analyzer(*this);
// TODO(fs): In what cases do we need this?
bool transformChanged = SVGLayoutSupport::transformToRootChanged(this);
- SVGLayoutSupport::layoutChildren(this, selfNeedsLayout(), transformChanged);
+
+ // When hasRelativeLengths() is false, no descendants have relative lengths
+ // (hence no one is interested in viewport size changes).
+ bool layoutSizeChanged = element()->hasRelativeLengths()
+ && SVGLayoutSupport::layoutSizeOfNearestViewportChanged(this);
+
+ SVGLayoutSupport::layoutChildren(this, selfNeedsLayout(), transformChanged, layoutSizeChanged);
updateCachedBoundaries();
clearNeedsLayout();
}

Powered by Google App Engine
This is Rietveld 408576698