Re: [w3c/webcomponents] "The event relatedTarget retargeting process must occur prior to dispatch of an event." (#485)

Ignoring `relatedTarget` and touch events for the moment, I have come up with this as a potential way to modify event dispatch taking into account multiple targets:
```
Event has an associated **path** (an ordered set).

Event has associated **targets** (an ordered set).

Dispatch(event, target, targetOverride):

  -> Append target to event's path.

  -> Append target to event's targets.

  -> Let parent be the result of invoking target's "get the parent" with event.

  -> While parent is non-null:

    -> Append parent to event's path.

    -> Append the result of "retargating" with parent and target to event's targets.

    -> Set parent to the result of parent's "get the parent" with event.
```
This does assume that https://w3c.github.io/webcomponents/spec/shadow/#dfn-retargeting-algorithm is correct, but it seems there should be a simpler way to calculate that without iterating over all target's ancestors.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/485#issuecomment-211914860

Received on Tuesday, 19 April 2016 13:00:12 UTC