Masayuki Nakano 735e6414f0 Bug 1909020 - Make createDragEventObject() in EventUtils.js aware of HiDPI environments r=smaug
`synthesizePlainDragAndDrop()` sends `drop` event [1] via `PresShell` [2].
Then, the `screenX` and `screenY` values are set to
`WidgetEvent::mRefPoint` [3].  Then, the `drop` event's position is
recorded before dispatch [4].  So, `drop` event is fired on the target
but the `mRefPoint` may be outside the target.  Finally, synthesized
`eMouseMove` after `eDrop` will be fired on the wrong element which is
different from `eDrop`'s target.  This caused the failures of
`test_synthmousemove_after_dnd.html` and `test_dragdrop.html` on Android.

Perhaps, we should improve `nsDOMWindowUtils` or something lower layer
later.  Instead, this patch fixes in `EventUtils.js` level.  This makes
the `createDragEventObject()`.

1. https://searchfox.org/mozilla-central/rev/6a72a6d20eeb1b20b93862a79166938d6ce794a0/testing/mochitest/tests/SimpleTest/EventUtils.js#3893-3900
2. https://searchfox.org/mozilla-central/rev/6a72a6d20eeb1b20b93862a79166938d6ce794a0/testing/mochitest/tests/SimpleTest/EventUtils.js#376-393,400
3. https://searchfox.org/mozilla-central/rev/6a72a6d20eeb1b20b93862a79166938d6ce794a0/dom/events/MouseEvent.cpp#81-84
4. https://searchfox.org/mozilla-central/rev/6a72a6d20eeb1b20b93862a79166938d6ce794a0/layout/base/PresShell.cpp#8987

Differential Revision: https://phabricator.services.mozilla.com/D251091
2025-05-24 23:37:50 +00:00
2025-05-10 01:55:32 +00:00

Firefox Browser

Firefox is a fast, reliable and private web browser from the non-profit Mozilla organization.

Contributing

To learn how to contribute to Firefox read the Firefox Contributors' Quick Reference document.

We use bugzilla.mozilla.org as our issue tracker, please file bugs there.

Resources

If you have a question about developing Firefox, and can't find the solution on Firefox Source Docs, you can try asking your question on Matrix at chat.mozilla.org in the Introduction channel.

Description
Preconfigured browser for YouTube's TV interface
Readme 5.5 GiB
Languages
JavaScript 32.6%
C++ 25.1%
HTML 20.9%
C 10.6%
Python 2.8%
Other 7.6%