Closed Bug 1845536 Opened 1 year ago Closed 9 months ago

During multitouch, only one PointerEvent reports valid offsetX/Y, with the rest returning zeroes

Categories

(Core :: DOM: Events, defect)

Firefox 115
All
Android
defect

Tracking

()

RESOLVED DUPLICATE of bug 1359440

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.

The severity field is not set for this bug.
:jonalmeida, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jonalmeida942)
Component: Browser Engine → Panning and Zooming
Product: Fenix → Core

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:

Flags: needinfo?(jonalmeida942)

The severity field is not set for this bug.
:botond, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(botond)

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.

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".

(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 to addEventListener?

(I confirmed that this has no effect on the observed behaviour.)

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.

Component: Panning and Zooming → DOM: Events
Flags: needinfo?(botond)

(For convenience, I also attached the working and non-working test cases to the bug.)

(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.)

Yeah, I wouldn't know. Edgar do you have an idea?

Flags: needinfo?(echen)

No, this is not a duplicate of bug 1524251, but bug 1359440.

Status: UNCONFIRMED → RESOLVED
Closed: 9 months ago
Duplicate of bug: 1359440
Flags: needinfo?(echen)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: