<?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>295936</bug_id>
          
          <creation_ts>2025-07-14 15:40:47 -0700</creation_ts>
          <short_desc>[css-anchor-position-1] anchor() fails to account for position-area</short_desc>
          <delta_ts>2025-07-29 12:19:54 -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 Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://github.com/web-platform-tests/wpt/pull/54018</see_also>
    
    <see_also>https://github.com/web-platform-tests/wpt/pull/54032</see_also>
          <bug_file_loc>https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cdiv%20style%3D%22height%3A%20100px%3B%20width%3A%20100px%3B%20border%3A%20solid%3B%20position%3A%20relative%3B%20%22%3E%0A%20%20%3Cdiv%20style%3D%22position%3A%20absolute%3B%20border%3A%20solid%20orange%3B%20margin%3A%202em%3B%20anchor-name%3A%20--foo%22%3E%3C%2Fdiv%3E%0A%20%20%3Cdiv%20style%3D%22height%3A%2040px%3B%20width%3A%2040px%3B%20background%3A%20silver%3B%20margin%3A%200.5em%22%3E%3C%2Fdiv%3E%0A%20%20%3Cdiv%20style%3D%22position%3A%20absolute%3B%20top%3A%20anchor(bottom)%3B%20position-area%3A%20bottom%20right%3B%20position-anchor%3A%20--foo%3B%20border%3A%20solid%20blue%22%3E%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%3Cdiv%20style%3D%22height%3A%20100px%3B%20width%3A%20100px%3B%20border%3A%20solid%3B%20position%3A%20relative%3B%20%22%3E%0A%20%20%3Cdiv%20style%3D%22position%3A%20absolute%3B%20border%3A%20solid%20orange%3B%20margin%3A%202em%3B%20anchor-name%3A%20--foo%22%3E%3C%2Fdiv%3E%0A%20%20%3Cdiv%20style%3D%22height%3A%2040px%3B%20width%3A%2040px%3B%20background%3A%20silver%3B%20margin%3A%200.5em%3B%20anchor-name%3A%20--bar%22%3E%3C%2Fdiv%3E%0A%20%20%3Cdiv%20style%3D%22position%3A%20absolute%3B%20top%3A%20anchor(--foo%20bottom)%3B%20position-area%3A%20bottom%20right%3B%20position-anchor%3A%20--bar%3B%20border%3A%20solid%20blue%22%3E%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A</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="fantasai">fantasai.bugs</reporter>
          <assigned_to name="fantasai">fantasai.bugs</assigned_to>
          <cc>bfulgham</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>2129996</commentid>
    <comment_count>0</comment_count>
    <who name="fantasai">fantasai.bugs</who>
    <bug_when>2025-07-14 15:40:47 -0700</bug_when>
    <thetext>Our anchor() resolution fails to account for the effects of grid-area when position-area is also used, so boxes end up in the wrong place. See testcase:

&lt;!DOCTYPE html&gt;
&lt;div style=&quot;height: 100px; width: 100px; border: solid; position: relative; &quot;&gt;
  &lt;div style=&quot;position: absolute; border: solid orange; margin: 2em; anchor-name: --foo&quot;&gt;&lt;/div&gt;
  &lt;div style=&quot;height: 40px; width: 40px; background: silver; margin: 0.5em&quot;&gt;&lt;/div&gt;
  &lt;div style=&quot;position: absolute; top: anchor(bottom); position-area: bottom right; position-anchor: --foo; border: solid blue&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;height: 100px; width: 100px; border: solid; position: relative; &quot;&gt;
  &lt;div style=&quot;position: absolute; border: solid orange; margin: 2em; anchor-name: --foo&quot;&gt;&lt;/div&gt;
  &lt;div style=&quot;height: 40px; width: 40px; background: silver; margin: 0.5em; anchor-name: --bar&quot;&gt;&lt;/div&gt;
  &lt;div style=&quot;position: absolute; top: anchor(--foo bottom); position-area: bottom right; position-anchor: --bar; border: solid blue&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cdiv%20style%3D%22height%3A%20100px%3B%20width%3A%20100px%3B%20border%3A%20solid%3B%20position%3A%20relative%3B%20%22%3E%0A%20%20%3Cdiv%20style%3D%22position%3A%20absolute%3B%20border%3A%20solid%20orange%3B%20margin%3A%202em%3B%20anchor-name%3A%20--foo%22%3E%3C%2Fdiv%3E%0A%20%20%3Cdiv%20style%3D%22height%3A%2040px%3B%20width%3A%2040px%3B%20background%3A%20silver%3B%20margin%3A%200.5em%22%3E%3C%2Fdiv%3E%0A%20%20%3Cdiv%20style%3D%22position%3A%20absolute%3B%20top%3A%20anchor(bottom)%3B%20position-area%3A%20bottom%20right%3B%20position-anchor%3A%20--foo%3B%20border%3A%20solid%20blue%22%3E%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%3Cdiv%20style%3D%22height%3A%20100px%3B%20width%3A%20100px%3B%20border%3A%20solid%3B%20position%3A%20relative%3B%20%22%3E%0A%20%20%3Cdiv%20style%3D%22position%3A%20absolute%3B%20border%3A%20solid%20orange%3B%20margin%3A%202em%3B%20anchor-name%3A%20--foo%22%3E%3C%2Fdiv%3E%0A%20%20%3Cdiv%20style%3D%22height%3A%2040px%3B%20width%3A%2040px%3B%20background%3A%20silver%3B%20margin%3A%200.5em%3B%20anchor-name%3A%20--bar%22%3E%3C%2Fdiv%3E%0A%20%20%3Cdiv%20style%3D%22position%3A%20absolute%3B%20top%3A%20anchor(--foo%20bottom)%3B%20position-area%3A%20bottom%20right%3B%20position-anchor%3A%20--bar%3B%20border%3A%20solid%20blue%22%3E%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2129998</commentid>
    <comment_count>1</comment_count>
    <who name="fantasai">fantasai.bugs</who>
    <bug_when>2025-07-14 15:41:59 -0700</bug_when>
    <thetext>Related: [css-anchor-1] anchor() fails to account for grid-area
https://bugs.webkit.org/show_bug.cgi?id=295924
rdar://155823420</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2129999</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-07-14 15:42:06 -0700</bug_when>
    <thetext>&lt;rdar://problem/155826872&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131678</commentid>
    <comment_count>3</comment_count>
    <who name="fantasai">fantasai.bugs</who>
    <bug_when>2025-07-21 13:25:35 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/48339</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2131782</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-07-21 20:00:14 -0700</bug_when>
    <thetext>Committed 297723@main (440717a86ea1): &lt;https://commits.webkit.org/297723@main&gt;

Reviewed commits have been landed. Closing PR #48339 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2133008</commentid>
    <comment_count>5</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2025-07-28 16:52:21 -0700</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/54018</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2133173</commentid>
    <comment_count>6</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2025-07-29 12:19:54 -0700</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/54032</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>