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: Mon, 13 Jul 2015 08:20:00 +0200
Message-ID: <CADnb78jbp0_v4-fDXQD6Q6NrZdbZG8CTpi3wcqkEjBbvLZi98A@mail.gmail.com>
To: WHATWG <whatwg@whatwg.org>
On Mon, Jul 13, 2015 at 8:09 AM, Elliott Sprehn <esprehn@chromium.org> wrote:
> Without such a function there's no primitive to explain how the scrolling
> and touch systems utilize this mayCancel bit unless we're saying the browser
> stores hidden state for event listeners in some WeakMap and all the browser
> systems use HiddenEventState.get(node).hasOnlyPassiveEventListeners(type).
> That's effectively what we'll have to implement internally, and if we don't
> expose it then we haven't explained the platform or given authors the
> ability to use this same optimization for their custom elements and events.

If you actually want to expose the primitives browsers use around
events you should advocate exposing the listeners. Since there's a
whole bunch of optimizations browsers already make based on the
presence/absence/type of those. But again, it's not entirely clear
that's a good idea.


-- 
https://annevankesteren.nl/
Received on Monday, 13 July 2015 06:20:26 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 July 2015 06:20:27 UTC