[Webkit-unassigned] [Bug 206374] New: [Shadow DOM] Non-composed CustomEvent's target property is not retargeted to null

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 16 14:20:07 PST 2020


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

            Bug ID: 206374
           Summary: [Shadow DOM] Non-composed CustomEvent's target
                    property is not retargeted to null
           Product: WebKit
           Version: Safari 13
          Hardware: Macintosh
                OS: macOS 10.14
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ravi.jayaramappa at salesforce.com

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200116/86963670/attachment.htm>


More information about the webkit-unassigned mailing list