Re: stopPropagation() or stopImmediatePropagation() called early

How does this mesh with the paragraph at the end of 3.1?
As the final step of the event dispatch, for reasons of backwards compatibility, the implementation must reset the event object's internal-propagation and default-action-prevention states.  This ensures that an event object may be properly dispatched multiple times while also allowing to prevent the event objects [sic] propagation or default actions prior to the event dispatch.


I can read that one of two ways, neither of which leads me to believe that a DISPATCH_REQUEST_ERR be thrown:
1) That after calling dispatchEvent, the event is back to its default state (reset the internal propagation state == clear the stopPropagation/stopImmediatePropagation flags), such that an immediate second call to dispatchEvent *would* dispatch the event as normal, rather than throw an exception..
2) That calling dispatchEvent is a complete no-op, so the event never "is already dispatched in the tree", according to the description of DISPATCH_REQUEST_ERR, and so said exception should not be thrown.

It seems like you're suggesting that the event *is* dispatched at least enough to know that that it's been dispatched and can't be re-dispatched, but then none of the event dispatch actually happens, including resetting the event.  So the only way to get that event to dispatch again would be to create a new event object?

Or, quite likely, am I just misreading things? :)

Ben Lerner
http://www.cs.washington.edu/homes/blerner

> Hi, Jonas-
>
> Jonas Sicking wrote (on 2/18/10 9:11 PM):
> > The most reasonable thing to do seems that dispatching an event which
> > has had stopPropagation() or stopImmediatePropagation() called on it
> > causes no dispatch to happen. I.e. the call to dispatchEvent is a
> > no-op (other than that if such an event is dispatched again, it raises
> > an DISPATCH_REQUEST_ERR exception).
>
> So let it be written; so let it be done.
>
> Regards-
> -Doug Schepers
> W3C Team Contact, SVG and WebApps WGs

Received on Friday, 26 February 2010 13:49:51 UTC