RESOLVED CONFIGURATION CHANGED 246451
Layout of nested grid with padding and aspect ratio fails
https://bugs.webkit.org/show_bug.cgi?id=246451
Summary Layout of nested grid with padding and aspect ratio fails
Johannes Odland
Reported 2022-10-13 04:02:01 PDT
Created attachment 462956 [details] Screenshot in Safari Element in grid container with aspect-ratio, padding and align-content: end is placed outside grid if grid container is nested in another grid container. I have replicated the bug in the following code pen: https://codepen.io/johannesodland/pen/xxjMgzr ```html <section> <div class="hero"> <h2>Title</h2> </div> </section> ``` ```css :root { --_padding: 15px; } section { display: grid; } .hero { display: grid; background-color: silver; aspect-ratio: 16 / 9; padding: var(--_padding); align-content: end; justify-items: start; } h2 { margin: 0; padding: var(--_padding); background: mediumorchid; } ``` Expected result: h2 is rendered inside padding at the bottom of the containing grid element. This is correct in Chrome and Firefox. Actual result: h2 is rendered 2 x padding below where it is expected, 1 x padding outside containing grid. The bug also happens if the grid is inside a flex container, but not if its in a flow container.
Attachments
Screenshot in Safari (14.65 KB, image/png)
2022-10-13 04:02 PDT, Johannes Odland
no flags
Screenshot in Chrome (45.38 KB, image/png)
2022-10-13 04:02 PDT, Johannes Odland
no flags
Johannes Odland
Comment 1 2022-10-13 04:02:33 PDT
Created attachment 462957 [details] Screenshot in Chrome
Karl Dubost
Comment 2 2022-10-13 19:03:44 PDT
Johannes, Thanks for the report. Can you reproduce in STP 155? https://developer.apple.com/safari/technology-preview/ It is working for me in STP 155.
Johannes Odland
Comment 3 2022-10-13 22:24:43 PDT
It works fine in TP 155. My bad, I should have checked there first. Do you know when the next release is due?
Radar WebKit Bug Importer
Comment 4 2022-10-20 04:02:20 PDT
Note You need to log in before you can comment on or make changes to this bug.