RESOLVED FIXED 225015
Block sizing is miscalculated for elements with a preferred aspect-ratio when padding is applied, and content can overflow.
https://bugs.webkit.org/show_bug.cgi?id=225015
Summary Block sizing is miscalculated for elements with a preferred aspect-ratio when...
Jen Simmons
Reported 2021-04-24 08:15:49 PDT
When `aspect-ratio` is applied to a box with content, the box should prevent overflow by growing to be tall enough to fit the content, plus space for whatever margins or padding are involved. From the spec: >In order to avoid unintentional overflow, the automatic minimum size in the ratio-dependent axis of a box with a preferred aspect ratio that is neither a replaced element nor a scroll container is its min-content size clamped from above by its maximum size. https://www.w3.org/TR/css-sizing-4/#aspect-ratio-minimum This works in the WebKit implementation, unless there is padding applied to the box. It looks like the padding is being subtracted from the height, instead of added, or something similarly weird. Example: https://labs.jensimmons.com/2021/aspect-ratio/04-bug.html
Attachments
Patch (2.11 KB, patch)
2021-04-24 10:54 PDT, Rob Buis
no flags
Patch (2.68 KB, patch)
2021-04-25 02:11 PDT, Rob Buis
no flags
Patch (2.45 KB, patch)
2021-04-25 03:43 PDT, Rob Buis
no flags
Patch (5.86 KB, patch)
2021-04-25 11:05 PDT, Rob Buis
no flags
Patch (5.77 KB, patch)
2021-04-28 10:03 PDT, Rob Buis
no flags
Rob Buis
Comment 1 2021-04-24 10:54:51 PDT
Rob Buis
Comment 2 2021-04-25 02:11:24 PDT
Rob Buis
Comment 3 2021-04-25 03:43:16 PDT
Rob Buis
Comment 4 2021-04-25 11:05:06 PDT
EWS Watchlist
Comment 5 2021-04-25 11:06:16 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Rob Buis
Comment 6 2021-04-28 10:03:54 PDT
Radar WebKit Bug Importer
Comment 7 2021-04-28 11:42:20 PDT
Rob Buis
Comment 8 2021-04-28 11:53:35 PDT
To be clear, the first patches had a WPT test included that I developed. Today I discovered that there is already a very similar WPT test available, so the latest patch imports that one.
Darin Adler
Comment 9 2021-04-28 12:05:36 PDT
Comment on attachment 427273 [details] Patch Looks OK. But there are multiple code changes and only one test case. Seems like we need more test cases. When I see branches in code I assume each needs a different test, so this seems to require at *least* 3 tests, but maybe more if we want to cover not changing the cases we don’t want to.
EWS
Comment 10 2021-04-28 18:00:35 PDT
Committed r276745 (237145@main): <https://commits.webkit.org/237145@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 427273 [details].
Note You need to log in before you can comment on or make changes to this bug.