Bug 256781 - [css-grid] Incorrect sizing of children of grid element placed inside flex element
Summary: [css-grid] Incorrect sizing of children of grid element placed inside flex el...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 16
Hardware: All macOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-05-15 05:20 PDT by Wojciech Maj
Modified: 2023-07-07 09:52 PDT (History)
5 users (show)

See Also:


Attachments
Repro (2.28 KB, text/html)
2023-05-15 05:20 PDT, Wojciech Maj
no flags Details
Code reproduction with textarea (334 bytes, text/html)
2023-07-07 09:52 PDT, Liam DeBeasi
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wojciech Maj 2023-05-15 05:20:29 PDT
Created attachment 466353 [details]
Repro

Children of grid element placed inside flex element have incorrect auto height calculated, causing said children, technically sitting on a grid, to overflow it.

# Steps to reproduce

* Open attached document in a decently sized window (higher than the gray container)
* Observe how backgroundContainer takes vertical space where in reality should be 0px high
* Observe how items with kittens "escape" the grid that is supposed to contain them
* Play around: resize window in BOTH directions to see the items moving around


# Test results

Note: All tests conducted on macOS Ventura 13.3.1 (22E261)

* Google Chrome 113.0.5672.92 - ✅
* Microsoft Edge 113.0.1774.42 - ✅
* Mozilla Firefox 113.0 - ✅
* Safari 16.4 (18615.1.26.11.23) - ❌
* Safari TP Release 168 (16.4, WebKit 18616.1.10.2) - ❌
Comment 1 Wojciech Maj 2023-05-15 05:41:01 PDT
I'm not sure if what I encountered is indeed just one bug, because there are two distinct ways to fix the bug (see repro source), so this leads me to believe that there might be in fact two bugs.
Comment 2 Radar WebKit Bug Importer 2023-05-15 06:40:21 PDT
<rdar://problem/109351052>
Comment 3 Liam DeBeasi 2023-07-07 09:52:01 PDT
Created attachment 466979 [details]
Code reproduction with textarea

I attached another reproduction of this bug. My reproduction shows a textarea escaping from the parent grid. In Safari, the textarea's height covers the entire screen. However, in Chrome and Firefox the textarea's height is around 30-40px.

Adding "grid-auto-rows: 100%" to the element with "display: grid" seems to avoid the issue.