W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2015

Re: [whatwg] DOM Events Proposal: EventListenerOptions 'mayCancel' for improved scroll performance

From: Anne van Kesteren <annevk@annevk.nl>
Date: Sat, 11 Jul 2015 21:14:34 +0200
Message-ID: <CADnb78h-E5THUsf1SE_ND5r+Px0Fb8xPYSP09zUaf8E=vSAMgw@mail.gmail.com>
To: Domenic Denicola <d@domenic.me>
Cc: "olli@pettay.fi" <olli@pettay.fi>, Rick Byers <rbyers@chromium.org>, Tim Dresser <tdresser@chromium.org>, WHATWG <whatwg@whatwg.org>, Boris Zbarsky <bzbarsky@mit.edu>, Dave Tapuska <dtapuska@chromium.org>, Jonas Sicking <jonas@sicking.cc>
On Sat, Jul 11, 2015 at 8:19 PM, Domenic Denicola <d@domenic.me> wrote:
> I'm not sure that actually matters though, since canceling inside setTimeout(,0) shouldn't have much affect besides changing `e.defaultPrevented`. So maybe it's OK.

It's fine. The code that dispatches an event and then checks the
event's canceled flag will run before a task queued by invoking
setTimeout() during dispatching runs. You can only change course if
you change the canceled flag during dispatch (which this new way of
listening would prevent).

Received on Saturday, 11 July 2015 19:15:03 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 11 July 2015 19:15:04 UTC