[whatwg/dom] Figure out how listeners should fire AT_TARGET when doing retargeting (#237)

There are few different options when listeners on non-deep target could fire.

(1) Gecko has traditionally fired listeners this way for XBL and such:
capturing listeners, capturing listener on non-deep-target, capturing listeners in shadow content capturing and bubble listeners on shadow-target, bubble listeners in shadow content, bubble listeners on non-deep-target, bubble listener 
That does differentiate capturing and bubble listeners at target phase when the .currentTarget there is a shadow host. But it keeps the algorithms rather easily understandable. There just is internal phase for the event and listeners are called based on that.
FWIW, Gecko uses this also for input elements and such where the implementation of the element is effectively a native shadow DOM thingie  (native anonymous content in Gecko terms)

(2) Other option is to call both capturing and bubble listeners during capture phase before entering shadow content. That gives non-shadow listeners priority over the listeners in shadow DOM.

(3) Same as (2) but call the listeners at target during bubble phase, when the listeners in shadow DOM has been called already.

I don't like (2).
(1) gives kind of best of both setups (2) and (3) depending on whether light DOM uses capturing or bubble listeners, but it makes the existence of shadow dom sort of visible, since the listeners at target aren't called in the order they were registered, but in the order they were registered for capture or non-capture phase. 
I think I could live with (3) too.

---
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/237

Received on Thursday, 21 April 2016 17:21:20 UTC