New issue
Advanced search Search tips

Issue 648375 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug

Blocking:
issue 648593



Sign in to add a comment

PointerEvent pressure is 1 when the pointer doesn't support pressure

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

Issue description

Steps to reproduce:
1. Go to http://codepen.io/appsforartists/pen/bwwxxK?editors=0011
2. Click and drag on the green area with a trackpad or mouse

Expected result:
event.pressure is .5, as specified in https://w3c.github.io/pointerevents/#dom-pointerevent-pressure 

"For hardware that does not support pressure, the value must be 0.5 when in the active buttons state and 0 otherwise."

Actual result:
event.pressure is 1
 

Comment 1 by mustaq@chromium.org, Sep 19 2016

Hi brentons@: Could you please specify the OS and Chrome version? We need more data to pin-point your test case---our test seems to suggest that the default pressure (0.5) is exposed for unreported cases:
https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-event-properties-expected.txt

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

Canary v55.0.2861.0 on a MacBook Pro.  I have a Wacom Intuos as my primary cursor and used the Mac's trackpad to find pressure == 1.
Project Member

Comment 3 by sheriffbot@chromium.org, Sep 20 2016

Labels: Hotlist-Google

Comment 4 by mustaq@chromium.org, Sep 20 2016

Blocking: 648593

Comment 5 by mustaq@chromium.org, Sep 20 2016

Labels: -Pri-2 OS-Mac Pri-3
Owner: lanwei@chromium.org
Status: Assigned (was: Unconfirmed)
Lan: The fix here seems closely related to the low-level pressure plumbing (https://codereview.chromium.org/2022843002). If Mac provides a way to check the availability of pressure data, then we should set force=NaN when not available. See:
https://cs.chromium.org/chromium/src/third_party/WebKit/public/platform/WebPointerProperties.h?dr=C&sq=package:chromium&rcl=1474355843&l=63

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

 Issue 648811  has been merged into this issue.
Project Member

Comment 7 by bugdroid1@chromium.org, Sep 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d0d3d88e1c94e01fb14ecdb3a11f786859236d5b

commit d0d3d88e1c94e01fb14ecdb3a11f786859236d5b
Author: lanwei <lanwei@chromium.org>
Date: Wed Sep 21 20:56:59 2016

Pressure should not be set when the pointer device doesn't support pressure.

When pointer events have a pointer type of mouse, we should not set their pressure,
the default value is 0.5 according to the spec.

In Cocoa Event doc, the pressure is only set for events with a subtype of NSTabletPointEventSubtype.
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/EventOverview/EventObjectsTypes/EventObjectsTypes.html#//apple_ref/doc/uid/10000060i-CH4-SW4

BUG= 648375 

Review-Url: https://codereview.chromium.org/2361523002
Cr-Commit-Position: refs/heads/master@{#420161}

[modify] https://crrev.com/d0d3d88e1c94e01fb14ecdb3a11f786859236d5b/content/browser/renderer_host/input/web_input_event_builders_mac.mm

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

@lanwei, it looks like Apple is also sending force for 3D Touch:

https://developer.apple.com/library/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_10_0.html

Should we send that value as pressure in Chrome PointerEvents where pointerType==mouse and the input device is a trackpad?

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

Unfortunately we do not have this trackpad to test, if we have we will add the pressure for it. But I guess the pressure will be from somewhere else, I noticed that there is special type of NSevent - 'pressure' will handle this case. Right now, the pressure I get is only for stylus devices 'Pointer Events', whose subtype is NSTabletPointEventSubtype.
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/EventOverview/EventObjectsTypes/EventObjectsTypes.html#//apple_ref/doc/uid/10000060i-CH4-SW4

Then I suggest you buy one.  =)

We should be discussing this in  https://crbug.com/581066 
Status: Fixed (was: Assigned)

Sign in to add a comment