Re: [whatwg/dom] Correct setting of target and relatedTargets post-dispatch (#585)

Tentative commit message:
```
Shadow: fix event dispatch

This makes a number of large changes to event dispatch:

* The algorithm can no longer return early with true. The observable
  aspect is that the event object is "uninitialized" and false might 
  be returned if the event object was already canceled.
* It accounts for Touch Events in shadow trees by adding the 
  "touch target list" which is somewhat similar to relatedTarget.
* Retargeting is now solely controlled by the event dispatch 
  algorithm. The hook for other specifications is removed.
* Retargeting now properly accounts for non-node objects.
* Dispatch in general accounts for non-node objects too now.
* If targets need to be unset to prevent exposure of a shadow tree
  this is now calculated prior to invoking listeners.

Initializing relatedTarget and "touch target list" is up to the event
classes that need it. #614 will add "event constructing steps" that
enable this.

Tests: https://github.com/w3c/web-platform-tests/pull/9919
(probably still needs work given today's changes)

This closes #402, fixes #561, fixes #562, fixes #580, and fixes #602.
```
So more review is welcome here (for the last two commits and this commit message in particular) and more tests.

Sorry it got so big, but I'm not sure this could be elegantly made smaller.

-- 
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/585#issuecomment-376480662

Received on Tuesday, 27 March 2018 10:47:35 UTC