Closed Bug 1944191 Opened 28 days ago Closed 27 days ago

`mousemove` should not be fired on the `Document` node if preceding boundary event removed the target and there is the last deepest `mouseenter` event target

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect

Tracking

()

VERIFIED FIXED
136 Branch
Tracking Status
relnote-firefox --- 135+
firefox135 --- verified
firefox136 --- verified

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

(Keywords: parity-chrome, webcompat:platform-bug)

Attachments

(2 files)

Chrome stops dispatching mousemove or pointermove if its preceding boundary event causes removing the target.

Oh, if mouseover target is just removed, Chrome dispatches a mousemove on the connected ancesto. However, if mouseover target is replaced, i.e., the element under the cursor is not a target of the enter targets, Chrome does not dispatch mousemove.

Err, no. Chrome fires mousemove on the connected ancestor even if the target is replaced. Hmm.

Chrome may change the behavior because they behave differently with/without the experimental feature, and we don't need this bug for bug 1943411. So, we should close this bug for now.

Status: ASSIGNED → RESOLVED
Closed: 28 days ago
Resolution: --- → WONTFIX

Okay, we should dispatch pointermove and mousemove on the last deepest "enter" event target (i.e., next deepest "leave" event target).

Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Status: REOPENED → ASSIGNED

Try: https://treeherder.mozilla.org/jobs?repo=try&resultStatus=usercancel%2Csuperseded%2Ctestfailed%2Cbusted%2Cexception%2Csuccess%2Cretry%2Crunning%2Cpending%2Crunnable&revision=bd411dfe6e0f4c6485ded787251e05cbc7e9c2d3

I got same result with Chrome Canary with enabling the new boundary event behavior for mouse, but it seems that Chrome Canary stops dispatching in pointer event case.

Chrome dispatches mousemove/pointermove event on the preceding mouseover
or pointerover target even if the target is removed from the DOM tree.
However, once the "Boundary Event Dispatch Tracks Node Removal" feature is
enabled, Chrome Canary dispatches mousemove/pointermove on the last
deepest mouseenter/pointerenter event target which is still connected.
Therefore, we should follow their new behavior if it's simply possible.

Attachment #9462240 - Attachment description: Bug 1944191 - Make `PresShell::EventHandler::DispatchEvent` retarget some pointer/mouse events if preceding boundary events removed the target r=smaug! → Bug 1944191 - Make `PresShell::EventHandler::DispatchEvent` retarget `mousemove` event if preceding boundary events removed the target r=smaug!
Summary: `mousemove`/`pointermove` should not be fired on the `Document` node if preceding boundary event removed the target → `mousemove` should not be fired on the `Document` node if preceding boundary event removed the target and there is the last deepest `mouseenter` event target
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/be17ac5dd59b Make `PresShell::EventHandler::DispatchEvent` retarget `mousemove` event if preceding boundary events removed the target r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/50339 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 28 days ago27 days ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
Upstream PR merged by moz-wptsync-bot

Chrome dispatches mousemove event on the preceding mouseover target even if
the target is removed from the DOM tree. However, once the
"Boundary Event Dispatch Tracks Node Removal" feature is enabled, Chrome Canary
dispatches mousemove on the last deepest mouseenter event target which is
still connected. Therefore, we should follow their new behavior if it's simply
possible.

Note that if pointeover target is removed, Chrome does not dispatch
pointermove on the last deepest pointerenter target. Therefore, this patch
limits the behavior change only for eMouseMove.

Original Revision: https://phabricator.services.mozilla.com/D235807

Attachment #9462461 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: Cannot use the menu in https://www.eclecticgames.co.uk/
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Go to https://www.eclecticgames.co.uk/ and move mouse cursor over the link under the searchbox, then, move the cursor down to over the popuped menu (the menu was closed when you move the mouse cursor on it)
  • Risk associated with taking this patch: Low
  • Explanation of risk level: The new behavior is redirecting mousemove event to nearest its ancestor which is still in the DOM tree. This does not match with current Chrome, but it's same as newer behavior of Chrome. Additionally, currently dispatchingmousemove onto the Document node is illegal from the UI Events spec.
  • String changes made/needed: none
  • Is Android affected?: yes
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Reproducible on 136.0a1 (20250127162202) and verified fixed on 136.0a1 (20250129050021).

Attachment #9462461 - Flags: approval-mozilla-release?
Attachment #9462461 - Flags: approval-mozilla-beta?
Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
Flags: in-testsuite+
Attachment #9462461 - Flags: approval-mozilla-release? → approval-mozilla-release+

Added to the 135.0.1 relnotes.

Fixed drop-down menus being unusable on some sites relying on certain mousemove event behavior.

Verified fixed using Firefox 135.0.1 (20250213194722) downloaded from Comment 15.

Component: DOM: Events → DOM: UI Events & Focus Handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: