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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/svg/LayoutSVGHiddenContainer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2007, 2008 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. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 calcViewport(); 54 calcViewport();
55 55
56 // Allow LayoutSVGTransformableContainer to update its transform. 56 // Allow LayoutSVGTransformableContainer to update its transform.
57 bool updatedTransform = calculateLocalTransform(); 57 bool updatedTransform = calculateLocalTransform();
58 58
59 // LayoutSVGViewportContainer needs to set the 'layout size changed' flag. 59 // LayoutSVGViewportContainer needs to set the 'layout size changed' flag.
60 determineIfLayoutSizeChanged(); 60 determineIfLayoutSizeChanged();
61 61
62 bool transformChanged = SVGLayoutSupport::transformToRootChanged(this); 62 bool transformChanged = SVGLayoutSupport::transformToRootChanged(this);
63 63
64 // When hasRelativeLengths() is false, no descendants have relative lengths
65 // (hence no one is interested in viewport size changes).
66 bool layoutSizeChanged = element()->hasRelativeLengths()
67 && SVGLayoutSupport::layoutSizeOfNearestViewportChanged(this);
68
64 // If any of this container's children need to be laid out, and a filter is 69 // If any of this container's children need to be laid out, and a filter is
65 // applied to the container, we need to issue paint invalidations for all 70 // applied to the container, we need to issue paint invalidations for all
66 // the descendants. 71 // the descendants.
67 bool forceLayoutOfChildren = selfNeedsLayout() 72 bool forceLayoutOfChildren = selfNeedsLayout()
68 || (normalChildNeedsLayout() && SVGLayoutSupport::hasFilterResource(*thi s)); 73 || (normalChildNeedsLayout() && SVGLayoutSupport::hasFilterResource(*thi s));
69 SVGLayoutSupport::layoutChildren(this, forceLayoutOfChildren, transformChang ed); 74 SVGLayoutSupport::layoutChildren(this, forceLayoutOfChildren, transformChang ed, layoutSizeChanged);
70 75
71 // Invalidate all resources of this client if our layout changed. 76 // Invalidate all resources of this client if our layout changed.
72 if (everHadLayout() && needsLayout()) 77 if (everHadLayout() && needsLayout())
73 SVGResourcesCache::clientLayoutChanged(this); 78 SVGResourcesCache::clientLayoutChanged(this);
74 79
75 if (m_needsBoundariesUpdate || updatedTransform) { 80 if (m_needsBoundariesUpdate || updatedTransform) {
76 updateCachedBoundaries(); 81 updateCachedBoundaries();
77 m_needsBoundariesUpdate = false; 82 m_needsBoundariesUpdate = false;
78 83
79 // If our bounds changed, notify the parents. 84 // If our bounds changed, notify the parents.
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 updateHitTestResult(result, localLayoutPoint); 198 updateHitTestResult(result, localLayoutPoint);
194 if (result.addNodeToListBasedTestResult(element(), localLayoutPoint) == StopHitTesting) 199 if (result.addNodeToListBasedTestResult(element(), localLayoutPoint) == StopHitTesting)
195 return true; 200 return true;
196 } 201 }
197 } 202 }
198 // 16.4: "If there are no graphics elements whose relevant graphics content is under the pointer (i.e., there is no target element), the event is not dispat ched." 203 // 16.4: "If there are no graphics elements whose relevant graphics content is under the pointer (i.e., there is no target element), the event is not dispat ched."
199 return false; 204 return false;
200 } 205 }
201 206
202 } // namespace blink 207 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/svg/LayoutSVGHiddenContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698