<?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>298680</bug_id>
          
          <creation_ts>2025-09-10 13:56:53 -0700</creation_ts>
          <short_desc>CSS Anchor Positioning prevents display transition when used with transition-behavior: allow-discrete</short_desc>
          <delta_ts>2025-09-29 13:10:27 -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>CSS</component>
          <version>Safari Technology Preview</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Zacky Ma">zacky</reporter>
          <assigned_to name="Antti Koivisto">koivisto</assigned_to>
          <cc>arrow_actions.7g</cc>
    
    <cc>fantasai.bugs</cc>
    
    <cc>kiet.ho</cc>
    
    <cc>koivisto</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2142189</commentid>
    <comment_count>0</comment_count>
    <who name="Zacky Ma">zacky</who>
    <bug_when>2025-09-10 13:56:53 -0700</bug_when>
    <thetext>When a [popover] element that&apos;s anchor positioned, e.g. to the toggle button, and it has `transition-behavior: allow-discrete`, e.g. we want to animate its opacity changes. The initial state of the popover renders correctly, and it can correctly transition to `:popover-open` with `display` set to a non-`none` value. But when it&apos;s closed, the `display` property remains instead of setting back to `none`.

This only happens when Anchor Positioning is used.

Reproduce: https://codepen.io/marchbox/pen/pvvKEGO</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2142200</commentid>
    <comment_count>1</comment_count>
    <who name="Zacky Ma">zacky</who>
    <bug_when>2025-09-10 14:21:03 -0700</bug_when>
    <thetext>Also tried to explicitly setting `display: none` for `:not(:popover-open)` instead of relying on the UA style, the bug persisted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2142494</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-09-11 17:24:01 -0700</bug_when>
    <thetext>&lt;rdar://problem/160421419&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2144174</commentid>
    <comment_count>3</comment_count>
    <who name="Ehren">arrow_actions.7g</who>
    <bug_when>2025-09-18 16:19:08 -0700</bug_when>
    <thetext>I was about to submit the same bug. Another Codepen is here: https://codepen.io/eharber/pen/yyeLgNz?editors=1100

Something else to note, is that the visibility and content-visibility properties (and potentially others) don&apos;t change either. So attempting to use this as a temporary solution doesn&apos;t work:

[popover]:not(:popover-open){
	display: none;
	visibility: hidden;
	content-visibility: hidden;
}

Closing the popover via .hidePopover() also fails.


If you need a hacky fix until this bug is solved, this seems help:
[popover]:not(:popover-open){
	opacity: 0;
	pointer-events: none;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2145257</commentid>
    <comment_count>4</comment_count>
      <attachid>476837</attachid>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2025-09-23 09:22:43 -0700</bug_when>
    <thetext>Created attachment 476837
Testcase reduction

Here&apos;s a test reduction</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2145813</commentid>
    <comment_count>5</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2025-09-25 01:32:36 -0700</bug_when>
    <thetext>Further reduced

&lt;div&gt;FAIL if this is visible&lt;/div&gt;

&lt;style&gt;
div {
  position-area: end;
  position: absolute;
  border: 1px solid;
  transition-behavior: allow-discrete;
  transition-duration: 1s;
}
&lt;/style&gt;
&lt;script&gt;
    document.body.offsetLeft;
    document.querySelector(&quot;div&quot;).style.display = &quot;none&quot;;
&lt;/script&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2145852</commentid>
    <comment_count>6</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2025-09-25 06:26:52 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/51313</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2145888</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-09-25 09:16:09 -0700</bug_when>
    <thetext>Committed 300519@main (a6a5ef3d9b99): &lt;https://commits.webkit.org/300519@main&gt;

Reviewed commits have been landed. Closing PR #51313 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2145890</commentid>
    <comment_count>8</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2025-09-25 09:48:31 -0700</bug_when>
    <thetext>https://github.com/web-platform-tests/wpt/pull/55064</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146931</commentid>
    <comment_count>9</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-09-29 13:10:27 -0700</bug_when>
    <thetext>Committed 297297.482@safari-7622-branch (5316cefdba80): &lt;https://commits.webkit.org/297297.482@safari-7622-branch&gt;

Reviewed commits have been landed. Closing PR #3717 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>476837</attachid>
            <date>2025-09-23 09:22:43 -0700</date>
            <delta_ts>2025-09-23 09:24:15 -0700</delta_ts>
            <desc>Testcase reduction</desc>
            <filename>file_298680.html</filename>
            <type>text/html</type>
            <size>411</size>
            <attacher name="Tim Nguyen (:ntim)">ntim</attacher>
            
              <data encoding="base64">PGRpdj5GQUlMIGlmIHRoaXMgaXMgdmlzaWJsZTwvZGl2Pg0KDQo8c3BhbiBpZD1hbmNob3I+PC9z
cGFuPg0KDQo8c3R5bGU+DQpkaXYgew0KICBwb3NpdGlvbi1hbmNob3I6IC0tYW5jaG9yOw0KICBw
b3NpdGlvbi1hcmVhOiBlbmQ7DQogIHBvc2l0aW9uOiBhYnNvbHV0ZTsNCiAgYm9yZGVyOiAxcHgg
c29saWQ7DQogIHRyYW5zaXRpb24tYmVoYXZpb3I6IGFsbG93LWRpc2NyZXRlOw0KICB0cmFuc2l0
aW9uLWR1cmF0aW9uOiAxczsNCn0NCg0KI2FuY2hvciB7DQogIGFuY2hvci1uYW1lOiAtLWFuY2hv
cjsNCn0NCjwvc3R5bGU+DQo8c2NyaXB0Pg0KICBzZXRUaW1lb3V0KCgpID0+IHsNCiAgICBkb2N1
bWVudC5xdWVyeVNlbGVjdG9yKCJkaXYiKS5zdHlsZS5kaXNwbGF5ID0gIm5vbmUiOw0KICB9LCAw
KQ0KPC9zY3JpcHQ+
</data>

          </attachment>
      

    </bug>

</bugzilla>