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

Re: stopPropagation() or stopImmediatePropagation() called early

From: Hallvord R. M. Steen <hallvord@opera.com>
Date: Wed, 03 Mar 2010 13:42:32 +0000
Message-ID: <20100303134232.ll5txpjy9coo0wcw@staff.opera.com>
To: Ben Lerner <t-benle@microsoft.com>
Cc: "www-dom@w3.org" <www-dom@w3.org>
Siterer Ben Lerner <t-benle@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 is a good point. Given that, I think an early exception would be  
appropriate - either specify that calling stop(Immediate)Propagation()  
before dispatch throws an error, or specify that calling  
dispatchEvent() throws if one of these methods were already called.

I guess it's simpler to make the methods throw. I can't think of any  
use cases for an event whose propagation is stopped before it's even  
dispatched, so that would likely be done by mistake.

Hallvord R. M. Steen
Core tester, Opera Software
Received on Wednesday, 3 March 2010 13:43:07 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:15 UTC