Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Only the first wheel event in a sequence should be cancelable #33

@RByers

Description

@RByers

non-passive wheel listeners are a problem for scroll performance. The problem for wheel is worse in some ways that for touchstart/touchmove because with touch at least it's just the beginning of the scroll that's blocked, not every single update. Most browsers already have some notion of a wheel sequence (group of wheel events that together "latch" to a single element, eg. based on when the users fingers actually lift from a touchpad). We could probably bring the "blocks only scroll start" property of touch events to wheel by saying that wheel events are uncancelable during a scroll (i.e. the site must cancel the first one if it wants to cancel any in a given sequence).

Off the top of my head here's the behavior of the various major browsers related to this:

  • Safari: Does latching (at least for touchpad) - so that there is a defined sequence of wheel events
  • Chrome: Is close to shipping latching.
  • Firefox: Latches, including generating "wheel transactions" based on a timer for mouse wheels which don't themselves have defined start/end. Also makes wheel events other than the first asynchronous so that cancelation is delayed (doesn't impact the scroll caused by that wheel event, only some future one).
  • Edge: Doesn't latch by default, but can be enabled with -ms-scroll-chaining: none. Doesn't send wheel events at all for high-precision touchpads.

Some day we might want to go further and try to address the first event problem (as we've done for touch in #18), but that's harder and much lower impact than this first step here.

/cc @tdresser @dtapuska who are thinking about this in blink.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions