During multitouch, only one PointerEvent reports valid offsetX/Y, with the rest returning zeroes
Categories
(Core :: DOM: Events, defect)
Tracking
()
People
(Reporter: yamplum, Unassigned)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0
Steps to reproduce:
When trying to implement a pinch-to-zoom gesture using PointerEvents, I wasn't getting correct results on mobile.
This is a minimal reproduction: https://jsfiddle.net/bc9t4dLh/1
(Largely copied from https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events/Pinch_zoom_gestures)
Open on mobile and try some multitouch gestures in the red area. You will see each event's offsets displayed.
Actual results:
Only the event corresponding to the most recently moved finger reports correct offsets, with the rest returning zeroes.
Expected results:
All captured events report correct offsets.
Comment 1•1 year ago
|
||
The severity field is not set for this bug.
:jonalmeida, could you have a look please?
For more information, please visit BugBot documentation.
Updated•1 year ago
|
more examples, where it is not working: https://rbyers.github.io/paint.html, https://bugreports.qt.io/browse/QTBUG-114228
though it seems to work using p5.js: https://editor.p5js.org/L05/sketches/Bk805C3jQ
I am using Qt myself and I'm not really good at reading JS code. But maybe it depends on the element, to which the touch events are registered? I believe, that these are the relevant p5js files:
is this a duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=1524251 ?
Updated•1 year ago
|
Comment 4•1 year ago
|
||
The severity field is not set for this bug.
:botond, could you have a look please?
For more information, please visit BugBot documentation.
Comment 5•9 months ago
|
||
Probably not relevant to the bug, but out of curiosity:
const log = document.getElementById('log');
document.addEventListener("pointerdown", function(e) {
evcache.push(e);
}, log);
what is the intended effect of passing an element (log
) as the third argument to addEventListener
? Based on the MDN docs, the expected value of the third argument is either a boolean or an options
object.
Comment 6•9 months ago
|
||
For ease of testing, I uploaded a simple HTML page version of the original JSFiddle testcase at https://theres-waldo.github.io/mozilla-testcases/bug1845536.html.
I can reproduce the issue on that page, and I also see that the Chrome behaviour matches the "expected results".
Comment 7•9 months ago
|
||
(In reply to Botond Ballo [:botond] from comment #5)
Probably not relevant to the bug, but out of curiosity, what is the intended effect of passing an element (
log
) as the third argument toaddEventListener
?
(I confirmed that this has no effect on the observed behaviour.)
Comment 8•9 months ago
|
||
I made an equivalent page that uses touch events rather than pointer events, https://theres-waldo.github.io/mozilla-testcases/bug1845536-touchevents.html. The behaviour on this page is the expected one (coordinates of all touch points are updated).
APZ sends touch events to content and pointer events are synthesized from the touch events on the content side. The observations here suggest that the touch events are correct but the pointer events are not, indicating an issue on the content side.
I'm accordingly going to move this bug to the DOM: Events component.
Comment 9•9 months ago
|
||
Comment 10•9 months ago
|
||
Comment 11•9 months ago
|
||
(For convenience, I also attached the working and non-working test cases to the bug.)
Comment 12•9 months ago
|
||
(In reply to Adam from comment #3)
is this a duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=1524251 ?
(It might be! I'll leave it to Andreas to confirm and dupe it over if that's the case.)
Comment 14•9 months ago
|
||
No, this is not a duplicate of bug 1524251, but bug 1359440.
Description
•