[LayoutNG] SVGs with percentage dimensions on child-initiated relayouts
On child-initiated re-layouts, SVG elements with percentage dimensions overflow auto-sized parents when LayoutNG is enabled. The reason being that ObjectIsRelayoutBoundary() treats all SVGs as layout roots upon re-layout, even when the width and height are not fixed. With LayoutNG enabled, this becomes a problem because BoxLayoutExtraInput does not get set when LayoutSVGRoot is a layout root, leading to a miscalculation in sizing. One option would be to set BoxLayoutExtraInput for LayoutSVGRoots when they are layout roots. However, in order to keep SVG behavior consistent with other objects, this change fixes the above issue by preventing layout root optimization altogether for SVG elements that do not have a fixed height and width. web_tests/paint/invalidation/svg/color-stop-properties.html was updated to use "width:100vw" and "height:100vh" instead of "width:100%" and "height:100%". With the new changes to ObjectIsRelayoutBoundary, an svg root with a percentage height and width will cause extra invalidation steps. Updating the width and height of the svg element in this test to an equivalent fixed height and width avoids extra invalidation steps and disruption to the test expectations. Bug: 1016759 Change-Id: Id0ccdafb20e5ce3a1b58be3577ca74dccc0c20c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1881691Reviewed-by:Morten Stenshorne <mstensho@chromium.org> Reviewed-by:
Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Alison Maher <almaher@microsoft.com> Cr-Commit-Position: refs/heads/master@{#712171}
Showing
Please register or sign in to comment