<?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>266524</bug_id>
          
          <creation_ts>2023-12-15 18:09:47 -0800</creation_ts>
          <short_desc>The focusin event from open shadow DOM does not bubble to parent document</short_desc>
          <delta_ts>2023-12-22 18:10:13 -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>UI Events</component>
          <version>Safari 17</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>macOS 13</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>
          
          <blocked>148695</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Sean Monahan">seanmonahan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2000121</commentid>
    <comment_count>0</comment_count>
    <who name="Sean Monahan">seanmonahan</who>
    <bug_when>2023-12-15 18:09:47 -0800</bug_when>
    <thetext>Steps to reproduce:

Clone repo https://github.com/ling1726/shadow-dom-focusin-repro

Setup

run npm install
run npm run dev
navigate to http://localhost:5173/
Steps

1. click on a button
2. output should be:

&gt; focusin listener - shadow root
&gt; focusin listener - document
&gt; click listener - shadow root
&gt; click listener - document

3. click on another button
4. output should be:

&gt; focusin listener - shadow root
&gt; click listener - shadow root
&gt; click listener - document


Actual results:

Each click event is received by the parent document of the open shadow root.
No focusin events are fired

Expeced results:
Each click event is received by the parent document of the open shadow root.

Each focusin event is received by the parent document of the open shadow root

MDN states (https://developer.mozilla.org/en-US/docs/Web/API/Event/composed)

&gt; All UA-dispatched UI events are composed (click/touch/mouseover/copy/paste, etc.). Most other types of events are not composed, and so will return false. For example, this includes synthetic events that are created without their composed option set too true.


As I understand it this means that focusin events should bubble up from the Shadow DOM.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2001671</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-12-22 18:10:13 -0800</bug_when>
    <thetext>&lt;rdar://problem/120059183&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>