Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify mousemove event target if preceding mouseout, mouseleave, mouseover or mouseenter event listener removes the mouseover target #393

Open
masayuki-nakano opened this issue Feb 5, 2025 · 1 comment

Comments

@masayuki-nakano
Copy link

For example if website does:

foo.addEventListener("mouseover", event => event.target.remove());

Then, where mousemove event should be targeted?

Firefox started targeting the closest connected ancestor of the removed target since 135.0.1 or later (not yet fixed the schedule, see bug 1944191. Before that, Firefox dispatched mousemove event on the Document node.

Chrome does same thing if enabling the new experimental behavior of mouse/pointer boundary events. However, Chrome with disabling the feature dispatches mousemove on the removed target.

According to the test result, Safari does not dispatch mousemove event or dispatches on the root element or dispatching to the Document or the Window.

@masayuki-nakano
Copy link
Author

I believe that mousemove should be fired on the connected closest ancestor of the removed target. I don't think browsers should do hittest again after dispatching mouse boundary events from both logical and performance points of view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant