Bug 270182 - Grid row of height minmax(0, 1fr) collapsing with container-type: inline-size
Summary: Grid row of height minmax(0, 1fr) collapsing with container-type: inline-size
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 17
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2024-02-27 11:24 PST by bart
Modified: 2024-05-29 03:58 PDT (History)
7 users (show)

See Also:


Attachments
screenshot safari 17.3 browserstack (235.24 KB, image/png)
2024-02-27 11:24 PST, bart
no flags Details
STP191 vs Other Browsers (451.11 KB, image/png)
2024-04-03 03:09 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description bart 2024-02-27 11:24:42 PST
Created attachment 470075 [details]
screenshot safari 17.3 browserstack

A grid cell and its grid container are not growing to fit their contents when the grid has `grid-template-rows: minmax(0, 1fr); container-type: inline-size;`.

See minimal reproduction at https://codepen.io/tremby/pen/OJGLmjo which has:

HTML:
<div id="grid">
  <div id="cell">
    This text should be surrounded by the black border and the grey border.
  </div>
</div>

CSS:
#grid {
  border: 5px solid lightgray;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  container-type: inline-size;
}
#cell {
  border: 1px solid black;
}

It is looking as expected (text is surrounded by the black cell border and the grey grid border) in Firefox and Chromium.

Screenshot of Safari 17.3 attached.

This issue is similar to https://bugs.webkit.org/show_bug.cgi?id=256047 and https://bugs.webkit.org/show_bug.cgi?id=260201 and https://bugs.webkit.org/show_bug.cgi?id=266506 but I do not know if it is a duplicate or something different.
Comment 1 Radar WebKit Bug Importer 2024-03-05 11:26:14 PST
<rdar://problem/124084850>
Comment 2 Ahmad Saleem 2024-04-03 03:09:06 PDT
Created attachment 470741 [details]
STP191 vs Other Browsers

It seems to be fixed in STP191 and all browsers are matching with each other.
Comment 3 Ahmad Saleem 2024-05-29 03:58:59 PDT
Since it is already fixed upstream and in Safari Technology Preview. Marking this as 'Configuration Changed'.

@Reporter - thanks for reporting.