Closed Bug 1317030 Opened 5 years ago Closed 5 years ago

Removing/reattaching an element from the DOM triggers spurious mouseenter events

Categories

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

47 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: abr, Assigned: smaug)

Details

Attachments

(2 files)

When an element is detached and then reattached to the DOM while the mouse pointer is inside it, it triggers the mouseenter event unnecessarily. The mouseover event does not exhibit this behavior.

STR: open the attached testcase. Move the mouse into the square. Move the mouse around. Compare to behavior in other browsers.
Component: DOM: Events → Event Handling
Assignee: nobody → bugs
Attached patch patchSplinter Review
I need to write still automatic test for this.
wpt can't deal with this kind of case, so it must be mochitest.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=4e5cb10aac2d724a5a2044cd569d2899842ebce8
Attachment #8810076 - Flags: review?(masayuki)
The idea with the patch is that we end up using the same recursion check what mouseover/out use.
Comment on attachment 8810076 [details] [diff] [review]
patch

If Dispatch() isn't called explicitly, should EnterLeaveDispatcher() call Dispatch() from the destructor? I think that it should do that, but up to you.

Otherwise, looks okay.
Attachment #8810076 - Flags: review?(masayuki) → review+
I guess I could add dtor which just asserts that Dispatch has been called.
Though, this is used only in two places so it should be rather obvious.
Haven't found a way to reproduce the issue automatically in mochitests :/
I think I pushed to try when m-i was anyhow broken.
Trying again
https://treeherder.mozilla.org/#/jobs?repo=try&revision=227e18990547789e15a27b2684e07be5ff618289
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9cb1f00af10b
Removing/reattaching an element from the DOM triggers spurious mouseenter events, r=masayuki
https://hg.mozilla.org/mozilla-central/rev/9cb1f00af10b
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.