<?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>309239</bug_id>
          
          <creation_ts>2026-03-05 00:36:42 -0800</creation_ts>
          <short_desc>[css-anchor-position-1] Element with display: contents doesn&apos;t establish an anchor scope when using anchor-scope</short_desc>
          <delta_ts>2026-03-30 17:24:20 -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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          
          <blocked>291856</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Gunnar Bittersmann">gunnar</reporter>
          <assigned_to name="Kiet Ho">kiet.ho</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>fantasai.bugs</cc>
    
    <cc>kiet.ho</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>2187292</commentid>
    <comment_count>0</comment_count>
    <who name="Gunnar Bittersmann">gunnar</who>
    <bug_when>2026-03-05 00:36:42 -0800</bug_when>
    <thetext>Hi,
this grid layout works fine in Firefox ans Chromium browsers: https://codepen.io/gunnarbittersmann/pen/OPRyObK The headings should be positioned above the first item of their section.

In Safari (26.3 on macOS and iOS), all headings are stacked onto each other at the position of the last section heading, as it would look like in other browser without `anchor-scope` being set.

May it be that `anchor-scope` doesn’t work well with `display: contents` on the same element?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2189457</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-03-12 01:37:11 -0700</bug_when>
    <thetext>&lt;rdar://problem/172355302&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2193312</commentid>
    <comment_count>2</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2026-03-24 16:06:27 -0700</bug_when>
    <thetext>Hello, thank you for your report. We do have a bug where a display: contents element would not establish an anchor scope, even if anchor-scope is set. A patch is forthcoming.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2193335</commentid>
    <comment_count>3</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2026-03-24 17:02:03 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/61288</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2193643</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-03-25 15:23:00 -0700</bug_when>
    <thetext>Committed 309946@main (89983a32335b): &lt;https://commits.webkit.org/309946@main&gt;

Reviewed commits have been landed. Closing PR #61288 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2195355</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-03-30 17:24:20 -0700</bug_when>
    <thetext>Committed 305413.596@safari-7624-branch (7cdb93183ef0): &lt;https://commits.webkit.org/305413.596@safari-7624-branch&gt;

Reviewed commits have been landed. Closing PR #4854 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>