<?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>211934</bug_id>
          
          <creation_ts>2020-05-14 16:53:48 -0700</creation_ts>
          <short_desc>AX: aria-modal=&quot;true&quot; autofocuses the first focusable child when inside an iframe</short_desc>
          <delta_ts>2021-02-01 12:08:41 -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 13</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</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="Devon Govett">govett</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cfleizach</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1652869</commentid>
    <comment_count>0</comment_count>
    <who name="Devon Govett">govett</who>
    <bug_when>2020-05-14 16:53:48 -0700</bug_when>
    <thetext>When rendering a dialog with `aria-modal=&quot;true&quot;` inside an iframe, Safari auto focuses the first focusable child of the dialog, even though the dialog itself is focused by JavaScript. No other browsers seem to have this behavior.

Reproduction: https://b3gkn.csb.app - the close button will be auto focused in Safari, after a flash of focus being on the dialog itself.
Opening the iframe page directly does not cause the issue: https://b3gkn.csb.app/iframe.html.

Source code for the reproduction: https://codesandbox.io/s/objective-currying-b3gkn?file=/index.html

I wouldn&apos;t expect the browser to auto focus anything with `aria-modal=&quot;true&quot;` (AFAIK no other browsers do this), but if it does, it should respect the element that the developer focuses with JavaScript.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1652870</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-05-14 16:53:58 -0700</bug_when>
    <thetext>&lt;rdar://problem/63249533&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1724351</commentid>
    <comment_count>2</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2021-02-01 12:05:58 -0800</bug_when>
    <thetext>(In reply to Radar WebKit Bug Importer from comment #1)
&gt; &lt;rdar://problem/63249533&gt;

on iOS, VoiceOver can&apos;t focus on a &quot;group&quot; like a dialog. it needs to focus on one of the flat elements in the list of elements to navigate. I think in the absence of further guidance it picks an element to land on.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>