Open Bug 1773886 Opened 3 years ago Updated 3 years ago

Intermittent wrong coordinates of dragend event

Categories

(Core :: DOM: Events, defect)

Firefox 101
Desktop
Windows 10
defect

Tracking

()

People

(Reporter: yuki, Unassigned)

References

Details

Attachments

(1 file)

Dragend events regularly report correct coordinates after the fix of the bug 1767165, but they still report wrong values intermittently. It is now seriously regressed because we web developers cannot apply workaround to shift coordinates constantly for such a situation.

Steps to reproduce

  1. Go to https://jsfiddle.net/piro_or/y9rq87s0/3/
  2. Hit F12 key to open the web console.
  3. Press the left mouse button on the "drag me!" button in the bottom-right section.
  4. Move the mouse a little to start drag session.
  5. Release the left mouse button immediately.
  6. Repeat steps 4 and 5 repeatedly (about 20-30 times for me).

Expected result

Constantly got console outputs with similar coordinates like:

ds Object { screenX: 1571, screenY: 720, clientX: 50, clientY: 24 }
de Object { screenX: 1578, screenY: 720, clientX: 57, clientY: 24 }
ds Object { screenX: 1573, screenY: 720, clientX: 52, clientY: 24 }
de Object { screenX: 1578, screenY: 722, clientX: 57, clientY: 26 }
ds Object { screenX: 1561, screenY: 717, clientX: 40, clientY: 21 }
de Object { screenX: 1569, screenY: 717, clientX: 48, clientY: 21 }

Actual result

Intermittently got console outputs with very different coordinates like:

ds Object { screenX: 1571, screenY: 720, clientX: 50, clientY: 24 }
de Object { screenX: 1578, screenY: 720, clientX: 57, clientY: 24 }
ds Object { screenX: 1573, screenY: 720, clientX: 52, clientY: 24 }
de Object { screenX: 1578, screenY: 722, clientX: 57, clientY: 26 }
ds Object { screenX: 1575, screenY: 720, clientX: 54, clientY: 24 }
de Object { screenX: 773, screenY: 190, clientX: -748, clientY: -506 } <= bad
ds Object { screenX: 1575, screenY: 720, clientX: 54, clientY: 24 }
de Object { screenX: 773, screenY: 190, clientX: -748, clientY: -506 } <= bad

Environment

  • Firefox 101.0 build ID: 20220526203855
  • Nightly 103.0a1 build ID: 20220612095651
  • Windows 10 21H2

The first bad build found by mozregression

app_name: firefox
build_date: 2022-05-03
build_file: C:\Users\piro.mozilla\mozregression\persist\2022-05-03--mozilla-central--firefox-102.0a1.en-US.win64.zip
build_type: nightly
build_url: https://archive.mozilla.org/pub/firefox/nightly/2022/05/2022-05-03-19-05-34-mozilla-central/firefox-102.0a1.en-US.win64.zip
changeset: ff375ced41f5e49d7a30ee1f59dcf7f52b7b469c
pushlog_url: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=4326a9c7fd280fb8c997afb874c7580f5fa5cd27&tochange=ff375ced41f5e49d7a30ee1f59dcf7f52b7b469c
repo_name: mozilla-central
repo_url: https://hg.mozilla.org/mozilla-central

This can reproduce on Nightly 103.0a1 on Ubuntu 20.04LTS, so it looks platform independent.

Blocks: 1773887

I could repro this (once) on the JSFiddle, but not in the standalone test-case from bug 1767165, can you confirm that? That is, do you see negative (or very wrong) clientY coordinates in https://bug1767165.bmoattachments.org/attachment.cgi?id=9274577?

Depends on: 1767165
Flags: needinfo?(yuki)
Attached file modified testcase

(In reply to Emilio Cobos Álvarez (:emilio) from comment #2)

I could repro this (once) on the JSFiddle, but not in the standalone test-case from bug 1767165, can you confirm that? That is, do you see negative (or very wrong) clientY coordinates in https://bug1767165.bmoattachments.org/attachment.cgi?id=9274577?

Yes, I can reproduce the problem on a standalone testcase.
I've modified the testcase to align output (see the attached file) and I got:

{"type":"ds","screenX":2324,"screenY":110,"clientX":37,"clientY":22}
{"type":"de","screenX":2330,"screenY":112,"clientX":43,"clientY":24}
{"type":"ds","screenX":2330,"screenY":106,"clientX":43,"clientY":18}
{"type":"de","screenX":2062,"screenY":3,"clientX":-225,"clientY":-85} <= bad
{"type":"ds","screenX":2337,"screenY":99,"clientX":50,"clientY":11}
{"type":"de","screenX":2339,"screenY":108,"clientX":52,"clientY":20}
{"type":"ds","screenX":2337,"screenY":101,"clientX":50,"clientY":13}
{"type":"de","screenX":2062,"screenY":3,"clientX":-225,"clientY":-85} <= bad
{"type":"ds","screenX":2331,"screenY":101,"clientX":44,"clientY":13}
{"type":"de","screenX":2337,"screenY":110,"clientX":50,"clientY":22}
{"type":"ds","screenX":2337,"screenY":104,"clientX":50,"clientY":16}
{"type":"de","screenX":2339,"screenY":114,"clientX":52,"clientY":26}

The X offset about 300 is from the visible sidebar. The Y offset about 100 is from visible toolbars (tab bar and nav bar).

Flags: needinfo?(yuki)
Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: