WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
UNCONFIRMED
40787
"mousewheel" event wheelDelta incorrectly delivers horizontal scroll deltas
https://bugs.webkit.org/show_bug.cgi?id=40787
Summary
"mousewheel" event wheelDelta incorrectly delivers horizontal scroll deltas
Nathan Vander Wilt
Reported
2010-06-17 10:10:03 PDT
The wheelDelta property of events delivered to a "mousewheel" listener incorrectly deliver horizontal (x-axis) scroll deltas when no vertical scroll occurred. This violates the W3C spec for legacy MouseWheelEvents (
http://www.w3.org/TR/DOM-Level-3-Events/#events-Events-MouseWheelEvent-wheelDelta
). To reproduce: 1. Load a web page, and enter the following into the JavaScript console: document.addEventListener("mousewheel", function(e) { console.log(e.wheelDelta, e.wheelDeltaY, e.wheelDeltaX); }); 2. Scroll vertically, diagonally and horizontally on the web page (using a MacBook trackpad or similar 2-axis continuous scrolling device) Expected results: A small vertical scrolls yields "75 75 0" A small diagonal scroll yields "55 55 45" A small horizontal scroll yields "0 0 75" That is: e.wheelDelta == e.wheelDeltaY at all times. Actual results: A small vertical scrolls yields "75 75 0" A small diagonal scroll yields "55 55 45" A small horizontal scroll yields "75 0 75" That is: e.wheelDelta == (e.wheelDeltaY || e.wheelDeltaX). This is incorrect. Workaround: The bad side effects of this behaviour can be avoided by checking mousewheel events for the e.wheelDeltaY property and using that instead of e.wheelDelta when the former is present.
Attachments
Add attachment
proposed patch, testcase, etc.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug