<?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>292516</bug_id>
          
          <creation_ts>2025-05-04 21:09:41 -0700</creation_ts>
          <short_desc>Inserting a subgrid child with `position: absolute` can cause `auto` column widths to be calculated incorrectly.</short_desc>
          <delta_ts>2025-05-11 21:10:12 -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 18</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 14</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>dwarn</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>karlcow</cc>
    
    <cc>sgill26</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>2114995</commentid>
    <comment_count>0</comment_count>
    <who name="">dwarn</who>
    <bug_when>2025-05-04 21:09:41 -0700</bug_when>
    <thetext>Overview:

Inserting a subgrid child with `position: absolute` can cause `auto` column widths to be calculated incorrectly.

---

Reproduction:

1. Go to https://codesandbox.io/p/sandbox/sleepy-noyce-vynd7s
2. Hover over the subgrid element to inject an element.
3. Or click the &apos;toggle inserted element&apos; button.

---

Generic Steps to Reproduce:

1. Create a grid with an `auto` width column and at least one other non-`auto` width column.

2. Create a subgrid that spans the entire parent grid.

3. Have a child that is always visible as part of the subgrid in the `auto` column.

4. Insert an absolutely positioned child in the non-`auto` column, after the initial load.

5. (Optional) remove the second child, the bug remains.

---

Actual Results:

The `auto` width column has an incorrect width. It looks like it is being treated as `1fr` instead.

---

Expected Results:

The `auto` width column should not be affected by the addition of a sibling with `position: absolute`.

The initial column width, before inserting the absolutely positioned second child, is correct and consistent with other browsers.

---

Build Date &amp; Hardware:

Safari 18.3 (19620.2.4.111.8, 19620) on MacOS 14.7.2

---

Additional Builds and Platforms:

Not reproducible on Chrome or Firefox.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2116026</commentid>
    <comment_count>1</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-05-08 19:36:41 -0700</bug_when>
    <thetext>This is interesting because sometimes I get the right layout. After a while the dashed border around subgrid child is exhibiting the right width. it takes a couple of seconds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2116405</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-05-11 21:10:12 -0700</bug_when>
    <thetext>&lt;rdar://problem/151125072&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>