Closed Bug 1638806 Opened 5 years ago Closed 5 years ago

Additional mouseenter are fired while switching to another TAB via keyboard shortcut

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox-esr68 --- unaffected
firefox76 --- unaffected
firefox77 --- unaffected
firefox78 --- fixed

People

(Reporter: edgar, Assigned: edgar)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Found this bug while investigating bug 1638091 and bug 1635784.

STR

  1. Open multiple tabs.
  2. Load https://codepen.io/edgarchen-the-decoder/pen/ExVONrm in one of the tabs.
  3. Move the mouse to the green area.
  4. Switch to another tab via keyboard shortcut (control+tab in MAC for example)
  5. Switch to the condepen tab via mouse click.

Expected result

Only mouseenter and mouseleave are logged in the green area.
The mouseenter is from step 3.
The mouseleave is fired because of switching to another tab in step 4.

Actual result

Additional mouseenter is fired.

This is actually a regression of bug 1607375.

What happens is while we switch from one tab to another by a keyboard shortcut, the synthesized mouse move event now dispatch to the new tab. And because of mLastOverElement still points to the old tab, so we will:

  1. Generate and dispatch a eMouseExitFromWidget to the old tab.
  2. Generate and dispatch a eMouseEnterIntoWidget to the new tab. At this step, since the sLastMouseRemoteTarget still pointers to the old tab, so we generate an additional eMouseExitFromWidget to the old tab in https://searchfox.org/mozilla-central/rev/9193635dca8cfdcb68f114306194ffc860456044/dom/events/EventStateManager.cpp#1324-1327.
Status: NEW → ASSIGNED
Regressed by: 1607375
Has Regression Range: --- → yes
Attachment #9150075 - Attachment description: Bug 1638806 - Test reproduce the bug; → Bug 1638806 - Do not update sLastMouseRemoteTarget for eMouseExitFromWidget event;

Set release status flags based on info from the regressing bug 1607375

Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/56423aee609e Do not update sLastMouseRemoteTarget for eMouseExitFromWidget event; r=smaug
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
See Also: → 1939670
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: