Closed Bug 1317030 Opened 7 years ago Closed 7 years ago

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


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

47 Branch
Not set



Tracking Status
firefox53 --- fixed


(Reporter: abr, Assigned: smaug)



(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.
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]

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 :/
Pushed by
Removing/reattaching an element from the DOM triggers spurious mouseenter events, r=masayuki
Closed: 7 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.