PointerEvent pressure is 1 when the pointer doesn't support pressure |
|||||
Issue descriptionSteps 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
,
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.
,
Sep 20 2016
,
Sep 20 2016
,
Sep 20 2016
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
,
Sep 21 2016
Issue 648811 has been merged into this issue.
,
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
,
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?
,
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
,
Sep 21 2016
Then I suggest you buy one. =) We should be discussing this in https://crbug.com/581066
,
Sep 22 2016
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by mustaq@chromium.org
, Sep 19 2016