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: Sun, 12 Jul 2015 08:40:16 +0200
Message-ID: <CADnb78jTgp9DDMX9PNQ_bqYqj_zjT73vNFHtkX6M9aTsh0cmxA@mail.gmail.com>
To: Rick Byers <rbyers@chromium.org>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, Jonas Sicking <jonas@sicking.cc>, WHATWG <whatwg@whatwg.org>, "olli@pettay.fi" <olli@pettay.fi>, Domenic Denicola <d@domenic.me>, Dave Tapuska <dtapuska@chromium.org>, Tim Dresser <tdresser@chromium.org>
On Sat, Jul 11, 2015 at 11:41 PM, Rick Byers <rbyers@chromium.org> wrote:
> What Anne describes is perfect!  I'm not hung up on the value of cancelable
> itself - some internal bit on Event that makes preventDefault a no-op (or
> event throw) during listener invocation is fine with me (and I agree - less
> weird).  If code really wants to test whether it's call to preventDefault
> took effect, it can check defaultPrevented afterward.

No, that is not what I said. I said we'd disable preventDefault() for
the listeners that have this bit set. If all listeners for a given
event have the bit said, the UA can make the optimization.

(And the setTimeout() example is perfectly deterministic. It changes
the canceled flag, but after that flag has been consulted by the
dispatcher.)


-- 
https://annevankesteren.nl/
Received on Sunday, 12 July 2015 06:40:49 UTC

This archive was generated by hypermail 2.3.1 : Sunday, 12 July 2015 06:40:51 UTC