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

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

Issue 1920833002: Don't force layout of descendants of SVG containers needing self-layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarify comments. Make some methods private. 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 8fd06fc0db188a8df60eb16fcf57986fcdc03415..d89246f7d212aa67df738a083dfaceaf76ce37da 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
@@ -44,6 +44,7 @@ LayoutSVGRoot::LayoutSVGRoot(SVGElement* node)
: LayoutReplaced(node)
, m_objectBoundingBoxValid(false)
, m_isLayoutSizeChanged(false)
+ , m_didScreenScaleFactorChange(false)
, m_needsBoundariesOrTransformUpdate(true)
, m_hasBoxDecorationBackground(false)
, m_hasNonIsolatedBlendingDescendants(false)
@@ -142,7 +143,12 @@ void LayoutSVGRoot::layout()
LayoutSize oldSize = size();
updateLogicalWidth();
updateLogicalHeight();
+
buildLocalToBorderBoxTransform();
+ // TODO(fs): Temporarily, needing a layout implies that the local transform
+ // has changed. This should be updated to be more precise and factor in the
+ // actual (relevant) changes to the computed user-space transform.
+ m_didScreenScaleFactorChange = selfNeedsLayout();
SVGLayoutSupport::layoutResourcesIfNeeded(this);
@@ -153,10 +159,7 @@ void LayoutSVGRoot::layout()
// (hence no one is interested in viewport size changes).
bool layoutSizeChanged = m_isLayoutSizeChanged && svg->hasRelativeLengths();
- bool forceLayoutOfChildren = selfNeedsLayout();
-
- const bool scalingFactorChanged = false;
- SVGLayoutSupport::layoutChildren(firstChild(), forceLayoutOfChildren, scalingFactorChanged, layoutSizeChanged);
+ SVGLayoutSupport::layoutChildren(firstChild(), false, m_didScreenScaleFactorChange, layoutSizeChanged);
if (m_needsBoundariesOrTransformUpdate) {
updateCachedBoundaries();

Powered by Google App Engine
This is Rietveld 408576698