WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
151093
Expose modern 'wheel' event parameters
https://bugs.webkit.org/show_bug.cgi?id=151093
Summary
Expose modern 'wheel' event parameters
loren.brichter
Reported
2015-11-10 07:17:22 PST
Current 'wheel' events only expose bare-minimum information (dx, dy) that doesn't fully capture how modern scrollwheels and trackpads behave. Exposing two additional pieces of information would greatly improve the possibilities for interesting custom event handling. 1. Inertial-scroll events. For example, on the Mac, by checking if a native event's 'momentumPhase' == NSEventPhaseNone, one can easily filter out synthesized inertial scroll events and only capture "real" events. It is important to distinguish them if you need to do custom scroll handling (with different physics parameters or boundary cases, where naive system-provided damping will not suffice). Developers have come up with horrible hacks to work around not having this information (see
https://libraries.io/npm/lethargy
and weep). 2. Direction-inversion. For example, on the Mac, by checking a native event's 'directionInvertedFromDevice' one can determine if scrolling deltas reflect the actual direction the user's fingers are moving on a trackpad. This is important to implement correct-feeling custom gesture handling (e.g. for non-2D-scrolling interactions). If I may humbly propose exposing a few additional properties on delivered DOM events: .[blink|webkit]ScrollingMomentumPhase : Possible values match those described by [1]. Developers can then easily filter out synthesized momentum events by ignoring all but 'PhaseNone' type events. .[blink|webkit]ScrollingInverted : boolean reflecting the value described by [2]. Thanks for taking this into consideration. [1]
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/#//apple_ref/occ/instp/NSEvent/momentumPhase
[2]
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/#//apple_ref/occ/instp/NSEvent/directionInvertedFromDevice
Attachments
Add attachment
proposed patch, testcase, etc.
loren.brichter
Comment 1
2015-11-10 07:48:24 PST
Chromium bug:
https://code.google.com/p/chromium/issues/detail?id=554012&thanks=554012&ts=1447168097
Firefox bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1223414
Radar WebKit Bug Importer
Comment 2
2015-11-10 08:22:46 PST
<
rdar://problem/23481214
>
loren.brichter
Comment 3
2015-11-25 10:26:28 PST
W3C discussions:
https://github.com/w3c/uievents/issues/57
https://github.com/w3c/uievents/issues/58
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