Intent to Ship: Make wheel event listeners passive by default on the root

87 views
Skip to first unread message

Emilio Cobos Álvarez

unread,
Oct 26, 2020, 12:45:49 PM10/26/20
to Mozilla
Summary: Make wheel / DOMMouseScroll / MozMousePixelScroll event
listeners on the root passive by default.

This effectively aligns with Chromium (see [1]), and with touchstart /
touchmove events.

Bug: 1673278

Standard: None, this is an intervention, though
https://w3c.github.io/uievents/#cancelability-of-wheel-events is loosely
related.

https://github.com/WICG/interventions/issues/64 is the main discussion.

Platform coverage: all

Preference: dom.event.default_to_passive_wheel_listeners

DevTools bug: N/A

Other browsers: Chromium-based browsers ship this since basically
forever. WebKit doesn't implement this, but it does implement a similar
quirk for touch events (as above), and I think implementing this would
allow them to get rid of a nasty hack in their events code too[2]
(interestingly chromium still keeps their smoothscroll.js intervention,
though I think it's just dead code at this point, I filed [3] for that).

web-platform-tests: This is not tested by WPT, as it's an intervention.
If WebKit decides to implement we should probably put this in a spec and
move tests there.

Cheers,

-- Emilio

[1]:
https://developers.google.com/web/updates/2019/02/scrolling-intervention
[2]: https://bugs.webkit.org/show_bug.cgi?id=207040
[3]: https://bugs.chromium.org/p/chromium/issues/detail?id=1142482

Anne van Kesteren

unread,
Oct 28, 2020, 6:18:54 AM10/28/20
to Emilio Cobos Álvarez, Mozilla
On Mon, Oct 26, 2020 at 5:45 PM Emilio Cobos Álvarez <emi...@mozilla.com> wrote:
> Standard: None, this is an intervention, though
> https://w3c.github.io/uievents/#cancelability-of-wheel-events is loosely
> related.

I'm not sure "it's an intervention" is sufficient reason as making
breaking changes to the web platform is not great for web developers,
but the fact that both Chrome and Safari already do this is, somewhat.
There is https://github.com/whatwg/dom/pull/366 which hasn't been
looked at since there only was one interested implementer. You should
probably take a look at that if that roughly matches part of the
changes you had to make. (Not sure who should own the "default passive
algorithm" for the root element though, HTML?)

Emilio Cobos Álvarez

unread,
Oct 28, 2020, 7:52:25 AM10/28/20
to Anne van Kesteren, Mozilla
Given Safari and us have been shipping the similar touch event
intervention for a long while it seems we should really merge that.

The IDL changes match the relevant gecko commit for that one:

https://hg.mozilla.org/mozilla-central/rev/99e592730f87f014a4d541ad301e27226d9e1cca
<https://hg.mozilla.org/mozilla-central/rev/99e592730f87f014a4d541ad301e27226d9e1cca>

Regarding to who should own the default algorithm probably HTML? Or
UI-events.

 -- Emilio

Reply all
Reply to author
Forward
0 new messages