W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2011

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

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 19 Sep 2011 23:29:59 +0000 (UTC)
To: David Flanagan <dflanagan@mozilla.com>
cc: www-dom@w3.org
Message-ID: <Pine.LNX.4.64.1109192329100.16440@ps20323.dreamhostps.com>
On Mon, 19 Sep 2011, 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.
> 
> The reason I ask is that browsers (at least Firefox and Chrome, and 
> possibly Safari) don't seem to implement it fully synchronously, and it 
> is easy to hose them with thousands of calls to dispatchEvent().  Does 
> HTML or some other spec override the DOM4 requirements?

Do you have an example showing asynchronous processing of dispatchEvent()?

(Is it just a nested event loop, or is the script somehow aborted and 
resumed later, or something else?)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 19 September 2011 23:32:38 GMT

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