Open Bug 1529953 Opened 6 years ago Updated 5 months ago

Consider supporting the legacy mousewheel event for interop.

Categories

(Core :: DOM: Events, enhancement, P3)

enhancement

Tracking

()

Webcompat Priority P2

People

(Reporter: twisniewski, Unassigned)

References

Details

(Keywords: dev-doc-needed, Whiteboard: parity-chrome parity-safari)

It seems that sites which play around with the (complicated) legacy mouse-wheel event system can be easily burned. For instance, typescriptlang.org's playground wants to override scrollbar behaviour by preventing the default mouse wheel events, but because it settles on DOMMouseScroll as the event type to prevent in Firefox, the events aren't actually prevented (MozMousePixelScroll would have to be prevented, if the site is only dealing with legacy events).

While the standard wheel event exists now to help with the situation, I feel it's worth supporting the "dominant" legacy event mousewheel as well if sites like typescriptlang.org are affected in ways that are subtle enough to not easily discover (or deemed worth to fix). According to MDN the mousewheel event seems to be supported by Blink, WebKit, Edge and Explorer, so it's pretty much entrenched.

Flags: webcompat?
Priority: -- → P3
See Also: → 1380217

See wheelDelta value of Chrome. Even if we follow Chrome's spec, the behavior does not make sense (although I don't check the latest behavior of Chrome).

Currently, I'm investigating what we can do for bug 1406243. One possible idea is, start to dispatch DOMMouseScroll with 0 for detail even in the cases we dispatch only MozMousePixelScroll. But if there are web apps which do like the following, it breaks the web apps anyway:

foo.addEventListener("DOMMouseScroll", (event) => {
  if (event.detail > 0) {
    // Do something for scroll to bottom event.
    return;
  }
  // Do something for scroll to up event.
});

So, 0 may be handled as scroll down or up.

Another possible idea is, we stop handling wheel events whose delta value is less than 1 line only when there is DOMMouseScroll non-passive listener, but no wheel nor MozMousePixelScroll. However, in this case, scroll will be started when user scrolls over one line. So, the UX becomes worse.

And if web apps call addEventListener() with both DOMMouseScroll and mousewheel (i.e., without UA check), both event listeners run only on Firefox. E.g., if both listeners are same function, Firefox users see x2 faster scroll for each wheel operation.

Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.

Webcompat Priority: --- → ?

See bug 1547409. Migrating whiteboard priority tags to program flags.

Whiteboard: [webcompat] → [webcompat-revisit]
Webcompat Priority: ? → revisit
Whiteboard: [webcompat-revisit]
Flags: webcompat?
See Also: → 1507150

Going to remove https://webcompat.com/issues/57716 from see also, since it was fixed so quickly by the site.
Also https://webcompat.com/issues/23101 was fixed by the site.

The Google search issue (bug #1507150) is the last remaining one that we know of. I pinged our Google contacts to see if they can resolve.

Hi Emilio, you added .wheelData* on bug 1708829, do you want to try this one too?

Depends on: 1708829
Flags: needinfo?(emilio)

I'm not sure what it'd entail, would it be reasonable enough to alias to wheel?

Flags: needinfo?(emilio)

I believe yes unless wheelData behaves differently on each event or there's some weird bubbling issue, but probably should double check.

Webcompat Priority: revisit → P2
Severity: normal → S3

Spec issue for mousewheel event: https://github.com/w3c/uievents/issues/331

Duplicate of this bug: 1689540

Seems fixed based on the linked wecompat issues:

Environment:
Operating system: Windows 10
Browsers tested: Firefox Nightly 128.0a1 (2024-05-28) / Firefox Release 126 / Chrome 125.0.6422.113

Based on this demo the mousewheel event is still not supported. https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=10430

Whiteboard: parity-chrome parity-safari
You need to log in before you can comment on or make changes to this bug.