W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2013

Re: Exceptions in event listeners triggered by dispatchEvent().

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 3 Jun 2013 11:32:32 -0700
Message-ID: <CA+c2ei_o2UdqM_=N_ng31cJLovA9w4NFpHkV2CqfHMq4AHKXUw@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: "www-dom@w3.org" <www-dom@w3.org>, John Barton <johnjbarton@google.com>
I think it would be great if dispatchEvent dispatched the event at
end-of-microtask or some such. Mainly to avoid reentrancy issues for web
authors. And returned a Future<boolean> to indicate if default action
should be run.

But there is absolutely no way that that is compatible with existing
content.

Best we can do is to introduce a new dispatch function that works that way.

/ Jonas
On Jun 3, 2013 10:46 AM, "Anne van Kesteren" <annevk@annevk.nl> wrote:

> On Mon, Jun 3, 2013 at 4:18 PM, John Barton <johnjbarton@google.com>
> wrote:
> > The confusing is the timing. dispatchEvent() acts in some ways as if it
> is
> > asynchronous -- errors do not propagate -- and in other ways as if it is
> --
> > the timing of the call is nested within the caller.  Simply queuing the
> > event for execution on the next turn would make the platform more
> > consistent.
>
> I'm not convinced, but lets say you're correct, what's the next step?
>
>
> --
> http://annevankesteren.nl/
>
>
Received on Monday, 3 June 2013 18:33:00 UTC

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