<?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>265989</bug_id>
          
          <creation_ts>2023-12-07 01:44:40 -0800</creation_ts>
          <short_desc>AX: Button label is not announced when inside shadowDOM</short_desc>
          <delta_ts>2023-12-18 15:29:24 -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>Accessibility</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>macOS 14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>264410</dup_id>
          
          <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="Istvan Tutto">istvantutto</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andresg_22</cc>
    
    <cc>tyler_w</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1997616</commentid>
    <comment_count>0</comment_count>
    <who name="Istvan Tutto">istvantutto</who>
    <bug_when>2023-12-07 01:44:40 -0800</bug_when>
    <thetext>When a button&apos;s label is provided via a slot that has a `display` style assigned to it, Safari will ignore the slotted content and announce the button without the label.

Demo:
https://codepen.io/istutto/pen/ZEwwzmv

How to reproduce:

For simplicity, I bypass the custom element definition (see demo above for full example).

Load a page with the following DOM:

&lt;button-label-fail&gt;
  &lt;template shadowrootmode=&quot;open&quot;&gt;
    &lt;button&gt;&lt;slot style=&quot;display: inline&quot;&gt;&lt;/slot&gt;&lt;/button&gt;
  &lt;/template&gt;
  Test label
&lt;/button-label-fail&gt;



Use the inspector of the developer tools on the `button` inside the shadowDOM and not how the button&apos;s label is not associated. This is even more obvious when using VoiceOver, as it will only announce `button` when focused.


---


This setup used to work in previous Safari releases (early v17 and before). We own and maintain a design system that provides components for millions of visitors daily. There have been many slot-related bugs in Safari recently, but this is the most severe regression I&apos;ve seen for a while.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1997617</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-12-07 01:44:50 -0800</bug_when>
    <thetext>&lt;rdar://problem/119303148&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2000557</commentid>
    <comment_count>2</comment_count>
    <who name="Tyler Wilcock">tyler_w</who>
    <bug_when>2023-12-18 15:29:11 -0800</bug_when>
    <thetext>This should be fixed by:

https://bugs.webkit.org/show_bug.cgi?id=264410

Which shipped in macOS 14.2 and iOS 17.2. Please let me know if you experience otherwise. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2000558</commentid>
    <comment_count>3</comment_count>
    <who name="Tyler Wilcock">tyler_w</who>
    <bug_when>2023-12-18 15:29:24 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 264410 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>