Re: Shadow DOM: events that are stopped

On Thu, Feb 7, 2013 at 7:02 AM, Anne van Kesteren <annevk@annevk.nl> wrote:

> Instead of having a fixed list of events that are stopped, maybe
> instead we can pass a flag to the dispatch algorithm with respect to
> whether or not the event being dispatched should exit the shadow
> boundary it started in, if any. That way you can have your own private
> event handling in the shadow tree and for components implemented by
> the user agent they can implement certain user actions as private to
> the shadow tree as well, but if I want I could still dispatch a
> synthetic "scroll" event that goes through the boundary.
>

This definitely sounds better than having a magic list of event names
somewhere.  Event names shouldn't have special meaning.

Should this be a flag on the event?  That puts it in the same place as the
other things with an effect on how the event is dispatched (bubbles,
cancelable), and so users can set the flag along with other flags, eg. new
Event("myevent", {stopsAtBoundary: true}).

I have a "clone_event()" function, to make a copy of a cancelled native
event for re-dispatching later.  Having this flag on the event would allow
that to remain self-contained, instead of one property of the event that
needs to be passed separately to dispatchEvent.

-- 
Glenn Maynard

Received on Thursday, 7 February 2013 15:07:31 UTC