<?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>302529</bug_id>
          
          <creation_ts>2025-11-14 05:23:32 -0800</creation_ts>
          <short_desc>Nested grids performance degradation</short_desc>
          <delta_ts>2026-01-13 01:55:48 -0800</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 26</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=232176</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=304869</see_also>
          <bug_file_loc>https://codepen.io/Punit-Rathod-the-selector/pen/JoPEbBw</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>punit.rathod</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>karlcow</cc>
    
    <cc>nipun_shukla</cc>
    
    <cc>rreno</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>2158770</commentid>
    <comment_count>0</comment_count>
      <attachid>477394</attachid>
    <who name="">punit.rathod</who>
    <bug_when>2025-11-14 05:23:32 -0800</bug_when>
    <thetext>Created attachment 477394
html file demonstrating the performance issue

A nested grid with large number of rows causes significant performance issues in Safari. Chrome and Firefox work without problems.

Codepen example and html file with a demo are attached</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2160541</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-11-21 05:24:11 -0800</bug_when>
    <thetext>&lt;rdar://problem/165205359&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2162040</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-11-30 16:17:18 -0800</bug_when>
    <thetext>@Punit, is there a live website where this is happening?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2162131</commentid>
    <comment_count>3</comment_count>
    <who name="">punit.rathod</who>
    <bug_when>2025-12-01 01:41:12 -0800</bug_when>
    <thetext>I originally came across the issue when trying to implement a new ui in our PWA www.wealthposition.com. We had to abandon the ui refresh because of this Safari issue. You can find a couple of other developers who complained about it here https://github.com/rachelandrew/gridbugs/issues/60

We do still have one component in our app which uses it, except we have to turn off nested grid and use the following hack workaround to make the page usable in Safari:
- Use css @supports to detect when a user is on Safari
- Turn off the native css nested grids
- use a .js script to resize the nested grids on every user interaction to keep everything in line. 

To see how the component performs in Safari (without the hacky workaround), you would have to:
- Log in
- Go to Budgets (using the left navigation menu)
- Create several grouped categories and budget rules
- Open web inspector, find the following css selector and turn it off:
@supports (hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none)  {
    .u-grid__subgrid {........}
}

If I let the native subgrid css run in Safari, the whole page becomes unresponsive - this is on an M1 Mac mini, Intel based Safari was much worse and would require force closing Safari. 

Chrome, Firefox, Samsung all work without any performance issues, including on low powered mobile devices which is what the PWA is supposed to work on as a minimum.

The nested grids are used for presenting a budget report with lots of rows (categories) and columns (months) which need to be aligned in a grid. Each row can have nested rows, and you can click a row to expand it to  see the rules assigned to the category. The nested rows are typically just 3 layers i.e. Group &gt; Categories in group &gt; rules in category and there would be 12 columns, one for each month. Just a few categories and rules is sufficient to crash Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2162135</commentid>
    <comment_count>4</comment_count>
    <who name="">punit.rathod</who>
    <bug_when>2025-12-01 01:47:08 -0800</bug_when>
    <thetext>(In reply to Karl Dubost from comment #2)
&gt; @Punit, is there a live website where this is happening?

Apologies, I posted a new comment instead of a reply to your comment. My response in in the comment before this one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2162144</commentid>
    <comment_count>5</comment_count>
    <who name="">punit.rathod</who>
    <bug_when>2025-12-01 02:13:30 -0800</bug_when>
    <thetext>I also wanted to say, even if the problem ever gets fixed, we would still have an issue in that we have no way of knowing if a user is running a version of Safari where the problem no longer exists because there is no @supports method to identify this. We are therefore now in a position where we can&apos;t really used subgrids in our website for several years. This is even though subgrid hit the &quot;Baseline&quot; standard for all major browsers back in 2023.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2171375</commentid>
    <comment_count>6</comment_count>
    <who name="Nipun Shukla">nipun_shukla</who>
    <bug_when>2026-01-13 01:55:48 -0800</bug_when>
    <thetext>This seems to have been fixed in 305121@main.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>477394</attachid>
            <date>2025-11-14 05:23:32 -0800</date>
            <delta_ts>2025-11-14 05:23:32 -0800</delta_ts>
            <desc>html file demonstrating the performance issue</desc>
            <filename>nested_grid_performance_issue_example.html</filename>
            <type>text/html</type>
            <size>2007</size>
            <attacher>punit.rathod</attacher>
            
              <data encoding="base64">PGh0bWw+CiAgPGhlYWQ+CiAgICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoKICAgICAgLmdyaWQg
ewogICAgICAgIGRpc3BsYXk6IGdyaWQ7CiAgICAgICAgZ3JpZC10ZW1wbGF0ZS1jb2x1bW5zOiBh
dXRvOwogICAgICB9CgogICAgICAuc3ViZ3JpZCB7CiAgICAgICAgZGlzcGxheTogZ3JpZDsKICAg
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