Closed Bug 1639368 Opened 6 years ago Closed 6 years ago

Additional mouseenter are fired while holding left button then switch tabs using keyboard

Categories

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

defect

Tracking

()

VERIFIED FIXED
mozilla79
Tracking Status
firefox79 --- verified
firefox80 --- verified

People

(Reporter: edgar, Assigned: edgar)

Details

Attachments

(1 file)

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. Click and hold mouse left button.
  5. Switch to another tab via keyboard shortcut (control+tab in MAC for example)
  6. Release the mouse button.
  7. Switch back to the condepen tab via clicking in tab bar.

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 5.

Actual results:

Additional mouseenter is fired. And another mouseleave is fired while mousing over the web content.

It doesn't look like a recent regression, given that I could reproduce this bug in 76 for example.

While the mouse moves from the old tab to the new tab, we should dispatch a eMouseExitFromWidget to the old tab and a eMouseEnterIntoWidget to the new tab, but the eMouseEnterIntoWidget is somehow dispatched to old tab instead.

I suspect it is because we track the mouse down for dragging gesture in https://searchfox.org/mozilla-central/rev/9193635dca8cfdcb68f114306194ffc860456044/dom/events/EventStateManager.cpp#1674, and use it as mCurrentTarget in https://searchfox.org/mozilla-central/rev/9193635dca8cfdcb68f114306194ffc860456044/dom/events/EventStateManager.cpp#1827.

We probably need to overwrite mCurrentTarget for eMouseEnterIntoWidget like what we do for eMouseExitFromWidget in https://searchfox.org/mozilla-central/rev/9193635dca8cfdcb68f114306194ffc860456044/dom/events/EventStateManager.cpp#4218-4222.

Attachment #9150298 - Attachment description: Bug 1639368 - Test reproduce the bug; → Bug 1639368 - Restore `mCurrentTarget` after handling drag gesture;

(In reply to Edgar Chen [:edgar] from comment #6)

https://treeherder.mozilla.org/#/jobs?repo=try&revision=58b4fa2f859ff193d3f6b217075dd435b0d85970

There is an intermittent failure on test verification on opt build.

Assignee: nobody → echen
Status: NEW → ASSIGNED
Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5a00363d2a4a Restore `mCurrentTarget` after handling drag gesture; r=smaug
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79

I managed to reproduce the issue using an older version of Nightly (2020-05-19). I retested everything on macOS 10.13, Windows 10 x64 and Ubuntu 18.04x64 using the latest Nightly 80.a1 and Firefox 79.0b3. The issue is not reproducing anymore.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: