Open
Bug 1223414
Opened 10 years ago
Updated 5 years ago
[Enhancement] Expose modern 'wheel' event parameters
Categories
(Core :: DOM: Events, defect, P5)
Core
DOM: Events
Tracking
()
UNCONFIRMED
People
(Reporter: loren.brichter, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.49 Safari/537.36
Steps to reproduce:
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
Actual results:
N/A
Expected results:
N/A
Reporter | ||
Comment 1•10 years ago
|
||
Updated•10 years ago
|
Component: Untriaged → DOM: Events
Product: Firefox → Core
Reporter | ||
Comment 2•10 years ago
|
||
Comment 3•5 years ago
|
||
Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority.
If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.
Severity: normal → S4
Priority: -- → P5
You need to log in
before you can comment on or make changes to this bug.
Description
•