<?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>291260</bug_id>
          
          <creation_ts>2025-04-08 03:11:59 -0700</creation_ts>
          <short_desc>[css-anchor-position-1] Subtree invisible when anchor-centered element visibility changes</short_desc>
          <delta_ts>2025-05-13 12:32:48 -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>DUPLICATE</resolution>
          <dup_id>291065</dup_id>
          
          <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="Pawel Lampe">plampe</reporter>
          <assigned_to name="Kiet Ho">kiet.ho</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>ian</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>2109689</commentid>
    <comment_count>0</comment_count>
      <attachid>474868</attachid>
    <who name="Pawel Lampe">plampe</who>
    <bug_when>2025-04-08 03:11:59 -0700</bug_when>
    <thetext>Created attachment 474868
small demo to reproduce the issue

Given anchor positioning is used and anchor target uses &apos;anchor-canter&apos; without using anchor() function for any insets,
When anchor target visibility changes (it becomes visible after being invisible i.e. display:none changes to e.g. display:flow),
Then the anchor target subtree is not rendered (no RenderObjects are created) and hence no anchor target children are visible.

I did some digging and it actually is a regression that was introduced here: https://github.com/WebKit/WebKit/commit/aa6b7858fefa58b92a4ba4da1df0b837fb5cf1c6 (Antti Koivisto: [css-anchor-position-1] Trigger evaluation of default anchor when it&apos;s used for anchor-center (https://bugs.webkit.org/show_bug.cgi?id=283295))

Small test case attached.

WPT test case is up for review: https://github.com/web-platform-tests/wpt/pull/51892</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2109743</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-04-08 11:01:31 -0700</bug_when>
    <thetext>&lt;rdar://problem/148840557&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2116848</commentid>
    <comment_count>2</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2025-05-13 12:32:48 -0700</bug_when>
    <thetext>Confirmed dupe of 291065.

*** This bug has been marked as a duplicate of bug 291065 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>474868</attachid>
            <date>2025-04-08 03:11:59 -0700</date>
            <delta_ts>2025-04-08 03:11:59 -0700</delta_ts>
            <desc>small demo to reproduce the issue</desc>
            <filename>6-min-repro.html</filename>
            <type>text/html</type>
            <size>750</size>
            <attacher name="Pawel Lampe">plampe</attacher>
            
              <data encoding="base64">PGh0bWw+CiAgPGhlYWQ+CiAgICA8c3R5bGU+CiAgICAgIC5idXR0b24gewogICAgICAgICAgYW5j
aG9yLW5hbWU6IC0tbWVudTsKICAgICAgfQogICAgICAubWVudSB7CiAgICAgICAgICBwb3NpdGlv
bjogZml4ZWQ7CiAgICAgICAgICBwb3NpdGlvbi1hbmNob3I6IC0tbWVudTsKICAgICAgICAgIC8q
IHRvcDogYW5jaG9yKGJvdHRvbSk7ICovCiAgICAgICAgICBoZWlnaHQ6IGF1dG87CiAgICAgICAg
ICBtYXJnaW46IDA7CiAgICAgICAgICBwYWRkaW5nOiAwOwogICAgICAgICAgb3ZlcmZsb3c6IGF1
dG87CiAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiByZWQ7CiAgICAgICAgICBqdXN0aWZ5LXNl
bGY6IGFuY2hvci1jZW50ZXI7CiAgICAgICAgICBkaXNwbGF5OiBub25lOwogICAgICB9CiAgICA8
L3N0eWxlPgogIDwvaGVhZD4KICA8Ym9keT4KICAgIHh4eCB5eXkgenp6PGJ1dHRvbiBpZD0iYnV0
dG9uIiBjbGFzcz0iYnV0dG9uIj5NZW51PC9idXR0b24+CiAgICA8ZGl2IGlkPSJtZW51IiBjbGFz
cz0ibWVudSI+CiAgICAgIDxsaT5Mb3JlbTwvbGk+CiAgICAgIDxsaT5JcHN1bTwvbGk+CiAgICAg
IDxsaT5Eb2xvcjwvbGk+CiAgICA8L2Rpdj4KICAgIDxocj48aHI+PGhyPgogICAgPHNjcmlwdD4K
ICAgICAgcmVxdWVzdEFuaW1hdGlvbkZyYW1lKCgpID0+IGRvY3VtZW50LmdldEVsZW1lbnRCeUlk
KCdtZW51Jykuc3R5bGUuZGlzcGxheSA9ICJmbG93Iik7CiAgICA8L3NjcmlwdD4KICA8L2JvZHk+
CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>