Re: [DOM4] EventTarget.dispatchEvent() is synchronous, right?

Thanks for the confirmation that dispatchEvent() is synchronous.

And apologies: my concerns about asynchronous behavior was caused by a 
bug in my benchmark code that was causing exponential behavior in the 
browsers I was testing.  Everything is nice and synchronous now.

     David

On 9/19/11 7:17 PM, Boris Zbarsky wrote:
> On 9/19/11 7:02 PM, David Flanagan wrote:
>> My reading of the DOM4 spec is that EventTarget.dispatchEvent() is
>> completely synchronous and does not involve the event loop in any way
>> and that any event handlers triggered in response to the dispatched
>> event are invoked before dispatchEvent() returns to its caller.
>
> This is correct, yes.
>
>> The reason I ask is that browsers (at least Firefox and Chrome, and
>> possibly Safari) don't seem to implement it fully synchronously
>
> I would love to see your testcase.  To the best of my knowledge, 
> dispatchEvent is completely synchronous in Gecko.
>
> -Boris
>

Received on Tuesday, 20 September 2011 17:37:22 UTC