W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2010

Re: stopPropagation() or stopImmediatePropagation() called early

From: Ben Lerner <t-benle@microsoft.com>
Date: Thu, 25 Feb 2010 18:24:54 +0000
To: "www-dom@w3.org" <www-dom@w3.org>
Message-ID: <2B307CC5A6F1D44A8FBD8E029A770BCA10AF5EB0@TK5EX14MBXC120.redmond.corp.microsoft.com>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:04 GMT