pointer events are cancelled even with touch-action: none on a scrollable page
Categories
(Core :: Panning and Zooming, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: timdream, Assigned: kats)
Details
Attachments
(4 files)
STR:
- On a touchscreen Windows device, like a Surface.
- Go to https://mdn.github.io/dom-examples/pointerevents/Pinch_zoom_gestures.html
- Make the page scrollable by doing |document.body.style.height = "120vh"|.
- Try to trigger pinch/zoom in the box.
Expected:
- It should work exactly as advertised.
Actual:
- Sometimes the pointer events will get cancelled for no reasons and the app will not be able to recognize the gesture.
Note:
- This won't happen, or happen less, when the page is not scrollable.
- I don't know if this happens on Firefox for Android or not but the page seems work fine if I turn on the responsive design mode. Although the page isn't exactly pannable on RDM.
- The demo is found on https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events/Pinch_zoom_gestures
Reporter | ||
Comment 1•5 years ago
|
||
The page on MDN with |height: 120vh| added.
Reporter | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
I can reproduce on Windows and Android (if dom.w3c_pointer_events.enabled=true). Basically if I go right into a pinch (both fingers down, then start moving) it doesn't work as expected. If I put one finger down, move it, then put the second finger down and move it, it does work. This seems to imply that APZ is detecting the first gesture as a pinch zoom and triggering pointercancel events when it's not supposed to (because the page has touch-action:none).
Assignee | ||
Comment 3•5 years ago
|
||
Presumably https://searchfox.org/mozilla-central/rev/ee3905439acbf81e9c829ece0b46d09d2fa26c5c/gfx/layers/apz/src/AsyncPanZoomController.cpp#1008 is returning true when it shouldn't be.
Assignee | ||
Comment 4•5 years ago
|
||
Initial investigation indicates that the APZ doesn't have the touch behaviours at the time of the pinch, so it defaults to allowing the pan-y action here.
Assignee | ||
Comment 5•5 years ago
•
|
||
This is kind of a silly thing: the layer tree and HitTestTreeNode instances have the right touch behaviours, but they only get sent to the InputQueue here which is a few lines after the ReceiveInputEvent that runs the ArePointerEventsConsumable
function. So from an APZ behaviour point of view, the touch action flags are set on the input block in time, but the nsEventStatus
return value is not as correct as it could be, which impacts pointer events.
A little plumbing should take care of this.
Assignee | ||
Comment 6•5 years ago
|
||
I have a fix, just need to write a test..
Assignee | ||
Comment 7•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&group_state=expanded&revision=a22ca8b40786524fbee2f7fe4e2f8b65bfa05d84 looks good, minus the ESlint failure.
https://treeherder.mozilla.org/#/jobs?repo=try&group_state=expanded&revision=3756179aa3f86b264447c2f4aa109387ce550e02 should have that fixed too.
Assignee | ||
Comment 8•5 years ago
|
||
Assignee | ||
Comment 9•5 years ago
|
||
Depends on D28433
Assignee | ||
Comment 10•5 years ago
|
||
Depends on D28434
Comment 11•5 years ago
|
||
Pushed by kgupta@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d3ab16a95b9c Put the touch behavior flags on the TouchBlockState earlier. r=botond https://hg.mozilla.org/integration/autoland/rev/51d8b82f8fbe Don't schedule a main-thread wait if the APZCTM provided the touch behaviours already. r=botond https://hg.mozilla.org/integration/autoland/rev/6c313c54c73b Add a mochitest. r=botond
Comment 12•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d3ab16a95b9c
https://hg.mozilla.org/mozilla-central/rev/51d8b82f8fbe
https://hg.mozilla.org/mozilla-central/rev/6c313c54c73b
Description
•