Re: stopPropagation() or stopImmediatePropagation() called early

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