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

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

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 19 Sep 2011 16:35:42 -0700
Message-ID: <CA+c2ei-dXmz8jDVNzviKpVF+y7FTX0Bw1AdDBq0mYgXZz+7tpA@mail.gmail.com>
To: David Flanagan <dflanagan@mozilla.com>
Cc: www-dom@w3.org
On Mon, Sep 19, 2011 at 4:02 PM, David Flanagan <dflanagan@mozilla.com> 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?

Oops, I missed the "n't" there. Firefox definitely implements
dispatchEvent fully synchronously, and I'd expect all other browsers
to as well. At least the ones which imeplements the DOM-Events spec,
which is nowadays true for all recent versions of the popular

/ Jonas
Received on Monday, 19 September 2011 23:36:47 UTC

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