<?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>283295</bug_id>
          
          <creation_ts>2024-11-18 04:01:33 -0800</creation_ts>
          <short_desc>[css-anchor-position-1] Trigger evaluation of default anchor when it&apos;s used for anchor-center</short_desc>
          <delta_ts>2025-02-18 09:43:29 -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>CSS</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Pawel Lampe">plampe</reporter>
          <assigned_to name="Antti Koivisto">koivisto</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>kiet.ho</cc>
    
    <cc>koivisto</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>2075800</commentid>
    <comment_count>0</comment_count>
    <who name="Pawel Lampe">plampe</who>
    <bug_when>2024-11-18 04:01:33 -0800</bug_when>
    <thetext>While working on anchor-center I&apos;ve discovered that in some cases the resolution of anchoring is not done and therefore the anchored elements are not being linked to anchors. In other words, in some cases it&apos;s impossible to fetch default anchor element (https://drafts.csswg.org/css-anchor-position-1/#default-anchor-element) of given element.

Example 1:
In case of https://github.com/web-platform-tests/wpt/blob/master/css/css-anchor-position/anchor-center-offset-change.html the position-anchor is set to --anchor (that is a valid anchor) and the left is set to anchor(--unknown right, 0px) - in this case the anchor resolution should succeed and the internal anchoring-related data structures should store the relation between anchor and the anchor target.

Example 2:
In case of https://github.com/web-platform-tests/wpt/blob/master/css/css-anchor-position/anchor-center-scroll.html the position-anchor is set to --anchor (that is a valid anchor) and yet no inset properties are using anchor() function. In this case the anchor resolution should still succeed and the internal anchoring-related data structures should store the relation between anchor and the anchor target.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2075840</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-11-18 08:35:10 -0800</bug_when>
    <thetext>&lt;rdar://problem/140124449&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2086703</commentid>
    <comment_count>2</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2025-01-13 02:15:18 -0800</bug_when>
    <thetext>I haven&apos;t dived into this, so some speculation:

We gather:
* all anchor references - anchor name used in anchor() or anchor-size(), or elements with anchor-center
* all anchors - elements with anchor-name specified.

Then we attempt to resolve the anchor references, using the gathered list of anchors.

I think the code right now only looks for anchor references in anchor() and anchor-size(). If an element uses anchor-center and not anchor()/anchor-size(), then the reference isn&apos;t caught, even though anchor-center refers to the default anchor.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2089205</commentid>
    <comment_count>3</comment_count>
    <who name="Pawel Lampe">plampe</who>
    <bug_when>2025-01-23 00:05:36 -0800</bug_when>
    <thetext>That&apos;s correct.

IMO we should store all the anchor-references used (along with position-anchor) or at least the default one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2090000</commentid>
    <comment_count>4</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2025-01-27 10:42:11 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/39599</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2095432</commentid>
    <comment_count>5</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2025-02-18 02:55:46 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/40758</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2095479</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-02-18 09:43:27 -0800</bug_when>
    <thetext>Committed 290534@main (aa6b7858fefa): &lt;https://commits.webkit.org/290534@main&gt;

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

    </bug>

</bugzilla>