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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. 5 * Copyright (C) 2009 Google, Inc.
6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 LayoutSize oldSize = size(); 144 LayoutSize oldSize = size();
145 updateLogicalWidth(); 145 updateLogicalWidth();
146 updateLogicalHeight(); 146 updateLogicalHeight();
147 buildLocalToBorderBoxTransform(); 147 buildLocalToBorderBoxTransform();
148 148
149 SVGLayoutSupport::layoutResourcesIfNeeded(this); 149 SVGLayoutSupport::layoutResourcesIfNeeded(this);
150 150
151 SVGSVGElement* svg = toSVGSVGElement(node()); 151 SVGSVGElement* svg = toSVGSVGElement(node());
152 ASSERT(svg); 152 ASSERT(svg);
153 m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size()); 153 m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size());
154 // When hasRelativeLengths() is false, no descendants have relative lengths
155 // (hence no one is interested in viewport size changes).
156 bool layoutSizeChanged = m_isLayoutSizeChanged && svg->hasRelativeLengths();
157
154 // If any of this root's children need to be laid out, and a filter is 158 // If any of this root's children need to be laid out, and a filter is
155 // applied to it, we need to issue paint invalidations for all descendants. 159 // applied to it, we need to issue paint invalidations for all descendants.
156 bool forceLayoutOfChildren = needsLayout 160 bool forceLayoutOfChildren = needsLayout
157 || (normalChildNeedsLayout() && SVGLayoutSupport::hasFilterResource(*thi s)); 161 || (normalChildNeedsLayout() && SVGLayoutSupport::hasFilterResource(*thi s));
162
158 const bool transformToRootChanged = false; 163 const bool transformToRootChanged = false;
159 SVGLayoutSupport::layoutChildren(this, forceLayoutOfChildren, transformToRoo tChanged); 164 SVGLayoutSupport::layoutChildren(this, forceLayoutOfChildren, transformToRoo tChanged, layoutSizeChanged);
160 165
161 if (m_needsBoundariesOrTransformUpdate) { 166 if (m_needsBoundariesOrTransformUpdate) {
162 updateCachedBoundaries(); 167 updateCachedBoundaries();
163 m_needsBoundariesOrTransformUpdate = false; 168 m_needsBoundariesOrTransformUpdate = false;
164 } 169 }
165 170
166 m_overflow.clear(); 171 m_overflow.clear();
167 addVisualEffectOverflow(); 172 addVisualEffectOverflow();
168 173
169 if (!shouldApplyViewportClip()) { 174 if (!shouldApplyViewportClip()) {
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 updateHitTestResult(result, pointInBorderBox); 414 updateHitTestResult(result, pointInBorderBox);
410 if (result.addNodeToListBasedTestResult(node(), locationInContainer, boundsRect) == StopHitTesting) 415 if (result.addNodeToListBasedTestResult(node(), locationInContainer, boundsRect) == StopHitTesting)
411 return true; 416 return true;
412 } 417 }
413 } 418 }
414 419
415 return false; 420 return false;
416 } 421 }
417 422
418 } // namespace blink 423 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698