Re: [whatwg/dom] Set event.target to null when dispatching finishes at ShadowRoot (#513)

> @TakayoshiKochi I don't quite know how relatedTarget works in all cases. Can we end up with a situation where target is null and relatedTarget is not? Or vice versa? Should we perhaps set both to null if either condition is true?

With the status quo, if an event bubbling ends up at a shadow root, its `relatedTarget` can be either in outside shadow tree or some shadow tree. If the former, `target` will become null but `relatedTarget` remain in my current spec patch - which may be weird and does not sound useful, even though it does not leak shadow tree.

On the other hand, once `event.target` is outside of any shadow tree, its corresponding `relatedTarget` should be also in the tree as a result of retargeting.

So I'm in favor of your idea, to set both to null if either condition is true.

> Also, is currentTarget affected?

`currentTarget` is already covered in step 16 (in the original spec) so that it will be set to null.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/513#issuecomment-334387376

Received on Thursday, 5 October 2017 07:55:19 UTC