New issue
Advanced search Search tips

Issue 648777 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

pointerup pressure should always be 0

Project Member Reported by brentons@google.com, Sep 20 2016

Issue description

"pointerup" is defined to be when a {finger,stylus} loses contact with the screen or when mouse buttons are no longer being pushed.  Therefore, I'd expect the pressure value of every pointerup event to be 0.  Moreover, the spec requires pressure to be 0 if the hardware doesn't support it and no buttons are active (that is, the pointer is up).

Maddeningly, its actual value is different across implementations.  Here's the current breakdown:

| Platform      | Browser        | Pointer      | pointerup pressure: 0 | pointerup pressure same as last pointermove |
| ------------- | -------------- | ------------ | --------------------- | ------------------------------------------- |
| Android       | Chrome         | touch        |                       | X                                           |
| iOS           | Safari via PEP | touch        |                       | X                                           |
| Mac           | Chrome         | trackpad     | X                     |                                             |
| Mac           | Chrome         | Wacom stylus | X                     |                                             |
| Mac           | Chrome         | Wacom touch  |                       | X (always 1, spec says it should be .5)     |
| Mac           | Firefox        | trackpad     | X                     |                                             |
| Mac           | Firefox        | Wacom stylus | X                     |                                             |
| Mac           | Firefox        | Wacom touch  | X                     |                                             |
| Mac           | Safari via PEP | trackpad     | X                     |                                             |
| Mac           | Safari via PEP | Wacom stylus | X                     |                                             |
| Mac           | Safari via PEP | Wacom touch  | X                     |                                             |
| ChromeOS      | Chrome         | touch        |                       | X                                           |
| ChromeOS      | Chrome         | trackpad     | X                     |                                             |
| Windows       | Chrome or Edge | touch        |                       | X                                           |
| Windows       | Chrome or Edge | trackpad     | X                     |                                             |
| Windows       | Chrome or Edge | stylus       | X                     |                                             |
| Windows       | Firefox        | touch        | X                     |                                             |
| Windows       | Firefox        | trackpad     | X                     |                                             |
| Windows       | Firefox        | stylus       | X                     |                                             |


tl;dr:

- Firefox always sets pressure to 0 in pointerup.
- The other desktop browsers use 0 for stylus and trackpad, but the last pointermove value for touch.
- iOS and Android both use the last pressure value from pointermove.

Can we please match Firefox's behavior (and what's already specified for pointers that don't support pressure) and enforce that pressure is always 0 in pointerup?
 

Comment 1 by brentons@google.com, Sep 20 2016

I forgot to include the link to my test:

http://codepen.io/appsforartists/full/gwLWVE/

If the background turns green on pointerup, pressure is 0.  If it turns red, pressure is using a stale value from pointermove.

Comment 2 by brentons@google.com, Sep 20 2016

Here are the relevant bugs against the spec and PEP:

https://github.com/w3c/pointerevents/issues/146/
https://github.com/jquery/PEP/issues/180/

Comment 3 by brentons@google.com, Sep 20 2016

Labels: OS-Android OS-Mac OS-Windows

Comment 4 by brentons@google.com, Sep 20 2016

Description: Show this description

Comment 5 by brentons@google.com, Sep 20 2016

Owner: nzolghadr@chromium.org

Comment 6 Deleted

Comment 7 by brentons@google.com, Sep 21 2016

Description: Show this description
Owner: lanwei@chromium.org
Status: Assigned (was: Unconfirmed)
Lan can you take a look at this one?

We can either just set the pressure of pointerup to 0 always in PointerEventFactory

https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/events/PointerEventFactory.cpp?q=PointerEventFactory&sq=package:chromium&dr=CSs&l=86

or maybe more ideally just set the force to nan for touchup in the lower levels for so that the code in blink follows the correct path in getPointerEventPressure.
Project Member

Comment 9 by sheriffbot@chromium.org, Sep 21 2016

Labels: Hotlist-Google
Status: Started (was: Assigned)
Status: Fixed (was: Started)

Sign in to add a comment