[LayoutNG] Fix replaced abspos with no intrinsic size
One more abspos edge case: Replaced element, with no intrinsic size, but with intrinsic aspect ratio. The example problem here is an SVG with aspect ratio, but no intinsic size. According to the spec, its inline size should fill container, and block size should be derived from inline size and aspect ratio. Existing code did not handle this case. If element had no size, its size would be computed and get clamped by minmax. A replaced element with no size gets a default minmax of 300x150, so elements would effectively get clamped to minmax. My fix is a bit of a hack. It uses absence of minmax as a signal that size should not be clamped. The intrinsic size handling is surprisingly complex for replaced elements. I wonder if there are any other parts of NG that need a close look in how replaced with aspect ratio/no size are handled. FF handles this correctly. Legacy does not. Bug: 1003545 Change-Id: I1510611ff84a99a26bcade74cace2855e022f997 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1830326 Commit-Queue: Aleks Totic <atotic@chromium.org> Reviewed-by:Morten Stenshorne <mstensho@chromium.org> Reviewed-by:
Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/master@{#702150}
Showing
Please register or sign in to comment