When a non-composed CustomEvent is dispatched inside a shadow tree and the event finishes processing, the event's target is expected to be null. Instead, the event'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 <div> #shadow-root (open) <span></span> </div> 2. Dispatch an event on span element and access the event's target property const event = new CustomEvent('test', { bubbles: true }); span.dispatchEvent(event); console.log(event.eventPhase); // 0 console.log(event.target); // <span> in Safari; null in Chrome, Firefox, Edge; jsbin repro https://jsbin.com/likekis/edit?html,js,console
Found the relevant web platform tests to be failing. https://wpt.fyi/results/shadow-dom/event-post-dispatch.html?label=experimental&label=master&aligned
<rdar://problem/58706920>
*** This bug has been marked as a duplicate of bug 218638 ***