8000 [css-om-view] How does scrolling relate to mouseWheel event propagation? · Issue #4680 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css-om-view] How does scrolling relate to mouseWheel event propagation? #4680

@smfr

Description

@smfr

https://drafts.csswg.org/cssom-view/#scrolling

We don't have interop on how mouse wheel events behave in nested, abspos scrollers:

Testcase: https://codepen.io/smfr/pen/rQZqxo

In Gecko, mousewheeling over a child scrollable element will propagate the events to any DOM ancestor that is scrollable, and, if the child is scrolled to the start/end, will trigger scrolls in that ancestor. This is the behavior you would expect from normal DOM event propagation, but doesn't necessarily match user expectation (you can end up scrolling something not under the pointer).

In WebKit/Blink, scrolls don't propagate to an ancestor if the child is absolutely positioned, even if the pointer is in a location that intersects both descendant and ancestor scroller.

No browser seems to propagate scrolls from an abspos, non-scrollable element to its scrollable DOM-ancestors (which doesn't seem to match normal DOM event propagation rules).

In addition, there are some differences in whether events inside an element, but outside its padding box (i.e. outside the scrollable part) trigger scrolling.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0