Re: [whatwg/dom] 'Retargeting steps' run at wrong time (#561)

Here's an idea:

* Instead of relatedTarget on events and event paths we rename that to relatedTargets (plural). It's a list of null/EventTarget objects.
* Events with a relatedTarget member set it to a list containing a single item. Touch events set it to a list containing all the targets of the various Touch objects (this is a fixed list).
* Then we make all the operations operating on relatedTarget work on a sequence instead.

I think this works since relatedTarget and touch events are mutually exclusive. Even if they weren't though, this could still work by relatedTarget just occupying a special slot.

The complexity here is that UI Events and Touch Events need to initialize relatedTargets properly, but that's all the complexity they need to worry about. Everything else can be done by the DOM Standard.

(I was initially thinking of handling `Touch` targets separately, but that just leads to a lot of duplication, so I think the above approach is preferable if it indeed works.)

cc @whatwg/components 

-- 
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/issues/561#issuecomment-371376005

Received on Thursday, 8 March 2018 04:34:55 UTC