<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>256781</bug_id>
          
          <creation_ts>2023-05-15 05:20:29 -0700</creation_ts>
          <short_desc>[css-grid] Incorrect sizing of children of grid element placed inside flex element</short_desc>
          <delta_ts>2025-04-07 01:47:55 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>Safari 16</version>
          <rep_platform>All</rep_platform>
          <op_sys>macOS 13</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Wojciech Maj">kontakt</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</cc>
    
    <cc>karlcow</cc>
    
    <cc>ldebeasi</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1955400</commentid>
    <comment_count>0</comment_count>
      <attachid>466353</attachid>
    <who name="Wojciech Maj">kontakt</who>
    <bug_when>2023-05-15 05:20:29 -0700</bug_when>
    <thetext>Created attachment 466353
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 &quot;escape&quot; 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) - ❌</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1955403</commentid>
    <comment_count>1</comment_count>
    <who name="Wojciech Maj">kontakt</who>
    <bug_when>2023-05-15 05:41:01 -0700</bug_when>
    <thetext>I&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1955407</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-05-15 06:40:21 -0700</bug_when>
    <thetext>&lt;rdar://problem/109351052&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1965596</commentid>
    <comment_count>3</comment_count>
      <attachid>466979</attachid>
    <who name="Liam DeBeasi">ldebeasi</who>
    <bug_when>2023-07-07 09:52:01 -0700</bug_when>
    <thetext>Created attachment 466979
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&apos;s height covers the entire screen. However, in Chrome and Firefox the textarea&apos;s height is around 30-40px.

Adding &quot;grid-auto-rows: 100%&quot; to the element with &quot;display: grid&quot; seems to avoid the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2108193</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-04-02 08:06:27 -0700</bug_when>
    <thetext>textarea test seems to work fine in Safari 18.4, the height of textarea is just 30 to 40px rather than full window height.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2108962</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-04-04 12:31:45 -0700</bug_when>
    <thetext>Other test - I updated with placeholder images - https://jsfiddle.net/jf6w20q7/ &lt;- seems to work fine as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2108963</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-04-04 12:32:29 -0700</bug_when>
    <thetext>@Karl - am I missing something here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2109359</commentid>
    <comment_count>7</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-04-07 01:47:31 -0700</bug_when>
    <thetext>placekitten.com is not serving images anymore. 
But even by using another service there is no difference in between browsers for the first test. 

The second test also is working correctly.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>466353</attachid>
            <date>2023-05-15 05:20:29 -0700</date>
            <delta_ts>2023-05-15 05:20:29 -0700</delta_ts>
            <desc>Repro</desc>
            <filename>safari-bug-grid-in-flex.html</filename>
            <type>text/html</type>
            <size>2330</size>
            <attacher name="Wojciech Maj">kontakt</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgoKPGhlYWQ+CiAgPG1ldGEgY2hhcnNldD0idXRmLTgiIC8+
CiAgPHRpdGxlPlNhZmFyaSBHcmlkIGluIEZsZXggYnVnPC90aXRsZT4KICA8c3R5bGU+CiAgICAu
Ym9keSB7CiAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47
CiAgICB9CgogICAgLnN0YWNrIHsKICAgICAgZGlzcGxheTogZ3JpZDsKICAgICAgZ2FwOiAyMHB4
OwogICAgICBiYWNrZ3JvdW5kOiByZ2IoMTUwIDE1MCAxNTApOwogICAgfQoKICAgIC5iYW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AgPGRpdiBjbGFzcz0iaXRlbSI+CiAgICAgICAgICA8ZGl2IGNsYXNzPSJpbWFnZUNvbnRhaW5l
ciI+CiAgICAgICAgICAgIDxpbWcgYWx0PSIiIGNsYXNzPSJpbWFnZSIgaGVpZ2h0PSIxNTAiIHNy
Yz0iaHR0cHM6Ly9wbGFjZWtpdHRlbi5jb20vMTUxLzE1MSIgd2lkdGg9IjE1MCIgLz4KICAgICAg
ICAgIDwvZGl2PgogICAgICAgIDwvZGl2PgogICAgICAgIDxkaXYgY2xhc3M9Iml0ZW0iPgogICAg
ICAgICAgPGRpdiBjbGFzcz0iaW1hZ2VDb250YWluZXIiPgogICAgICAgICAgICA8aW1nIGFsdD0i
IiBjbGFzcz0iaW1hZ2UiIGhlaWdodD0iMTUwIiBzcmM9Imh0dHBzOi8vcGxhY2VraXR0ZW4uY29t
LzE1Mi8xNTIiIHdpZHRoPSIxNTAiIC8+CiAgICAgICAgICA8L2Rpdj4KICAgICAgICA8L2Rpdj4K
ICAgICAgPC9kaXY+CiAgICA8L2Rpdj4KICA8L2Rpdj4KPC9ib2R5PgoKPC9odG1sPgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>466979</attachid>
            <date>2023-07-07 09:52:01 -0700</date>
            <delta_ts>2023-07-07 09:52:01 -0700</delta_ts>
            <desc>Code reproduction with textarea</desc>
            <filename>index.html</filename>
            <type>text/html</type>
            <size>334</size>
            <attacher name="Liam DeBeasi">ldebeasi</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPG1ldGEgY2hhcnNldD0iVVRGLTgi
IC8+CiAgICA8bWV0YSBuYW1lPSJ2aWV3cG9ydCIgY29udGVudD0id2lkdGg9ZGV2aWNlLXdpZHRo
LCBpbml0aWFsLXNjYWxlPTEiIC8+CiAgPC9oZWFkPgogIDxib2R5PiAgIAogICAgPGRpdiBzdHls
ZT0iZGlzcGxheTpmbGV4OyBmbGV4LWRpcmVjdGlvbjogY29sdW1uOyI+CiAgICAgIDxkaXYgc3R5
bGU9ImRpc3BsYXk6IGdyaWQ7IGhlaWdodDogMTAwJTsiPgogICAgICAgIDx0ZXh0YXJlYT48L3Rl
eHRhcmVhPgogICAgICA8L2Rpdj4KICAgIDwvZGl2PgogIDwvYm9keT4KPC9odG1sPg==
</data>

          </attachment>
      

    </bug>

</bugzilla>