Re: [whatwg/dom] Consider making dispatchEvent() unset stop (immediate) propagation flags (#219)

I think Gecko resets effectively at the end of dispatch.  Beginning vs. end is distinguishable if you call .stopPropagation() outside of a dispatch.  Resetting at the beginning of dispatch would mean that .stopPropagation is restricted to the current event dispatch and does nothing if the event is not currently being dispatched.  Resetting at the end would mean it's restricted to the current event dispatch, or next one if the event is not currently being dispatched.

Resetting at the beginning of dispatch seems simplest.  It means you can use an event object multiple times without having to call initEvent() again (which new event types don't have, right?).  I don't see why the event shouldn't be reusable just because you didn't reinitialize it -- it doesn't seem intuitive to me.  If we do this, we could then remove the reset in initEvent, because it's no longer black-box detectable.

I don't know why authors are dispatching their own events at all, by the way, let alone why the same event twice.  But given that we do allow dispatching the same event twice, I don't see how it makes any sense for a previous .stopPropagation() call to ever stop future dispatches.

---
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/219#issuecomment-211366587

Received on Monday, 18 April 2016 12:50:21 UTC