Bug 91799 - Touch force values can be outside the valid range on Android
: Touch force values can be outside the valid range on Android
Status: NEW
: WebKit
HTML Events
: 528+ (Nightly build)
: Android Android
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-07-19 16:54 PST by
Modified: 2012-12-04 09:13 PST (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2012-07-19 16:54:49 PST
The TouchEvent v2 spec says that force should be between 0 and 1: http://dvcs.w3.org/hg/webevents/raw-file/default/touchevents.html#widl-Touch-force

On Android I can easily get values greater than 1.  We should probably try to infer the maximum value (maybe by keeping track) and scale appropriately.  Alternately we should consider not reporting force at all (in order to avoid a compatibility burden later).

Test pages I used are:
http://www.rbyers.net/paint.html
http://www.rbyers.net/eventTest.html (with 'simple' turned off to get force/radius info)

Ben, please reassign as appropriate.
------- Comment #1 From 2012-12-04 09:13:45 PST -------
+peter who said he could look into this.

benm said:
Force correlates to the Android MotionEvent.getPressure API, which the documentation states that the value "generally ranges from 0 (no pressure at all) to 1 (normal pressure), however values higher than 1 may be generated depending on the calibration of the input device."

Would it be reasonable to just trunacte the values we get out of the Android API at 1 in order to be compliant?