<?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>206374</bug_id>
          
          <creation_ts>2020-01-16 14:20:07 -0800</creation_ts>
          <short_desc>Non-composed CustomEvent&apos;s target property is not retargeted to null</short_desc>
          <delta_ts>2020-11-09 08:48:44 -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>DOM</component>
          <version>Safari 13</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>218638</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>148695</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Ravi Jayaramappa">ravi.jayaramappa</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>1607664</commentid>
    <comment_count>0</comment_count>
    <who name="Ravi Jayaramappa">ravi.jayaramappa</who>
    <bug_when>2020-01-16 14:20:07 -0800</bug_when>
    <thetext>When a non-composed CustomEvent is dispatched inside a shadow tree and the event finishes processing, the event&apos;s target is expected to be null. Instead, the event&apos;s target is pointing to the element on which it was dispatched. This behavior differs from the other browsers, where the event target is null.

Repro steps:

1. Construct a DOM tree of this form
&lt;div&gt;
   #shadow-root (open)
     &lt;span&gt;&lt;/span&gt;
&lt;/div&gt;

2. Dispatch an event on span element and access the event&apos;s target property
const event = new CustomEvent(&apos;test&apos;, { bubbles: true });
span.dispatchEvent(event);
console.log(event.eventPhase); // 0
console.log(event.target); // &lt;span&gt; in Safari; null in Chrome, Firefox, Edge;

jsbin repro
https://jsbin.com/likekis/edit?html,js,console</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1608106</commentid>
    <comment_count>1</comment_count>
    <who name="Ravi Jayaramappa">ravi.jayaramappa</who>
    <bug_when>2020-01-17 11:14:20 -0800</bug_when>
    <thetext>Found the relevant web platform tests to be failing. https://wpt.fyi/results/shadow-dom/event-post-dispatch.html?label=experimental&amp;label=master&amp;aligned</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1608403</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-01-17 23:28:12 -0800</bug_when>
    <thetext>&lt;rdar://problem/58706920&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1705718</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2020-11-09 08:48:44 -0800</bug_when>
    <thetext>

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

    </bug>

</bugzilla>