Closed Bug 1917488 Opened 5 months ago Closed 3 months ago

Switching tabs while zooming in/out causes further zoom in/outs to happen in wrong tab

Categories

(Core :: Panning and Zooming, defect, P2)

Firefox 130
defect

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox132 --- wontfix
firefox133 --- wontfix
firefox134 --- fixed

People

(Reporter: mcccs, Assigned: botond)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(3 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0

Steps to reproduce:

I encounter this bug very often in my normal browsing experience but it's harder to trigger it instantly for testing experience:

Crazily zooming in and out while having two tabs open and switching between them causes at some point not being able to zoom in/out, and it turns out that the tab in the background did zoom in/out instead!

Mozregression (it is actually hard to use this because it's hard to decide "it has had enough testing" with 100% confidence when it's working correctly.):
2024-09-08T19:50:19.886000: DEBUG : Found commit message:
Bug 1902017 - Update the event layers id to that of the APZ pan gesture block state. r=botond

Ensure that weel events for a pan gesture are sent to the content
process for the layers id of the APZC that is handling the pan gesture.
The corresponding content process should also have a content side wheel
transaction that will ensure that content that is scrolled over cannot
halt a user scroll with preventDefault on a wheel event listener.

Differential Revision: https://phabricator.services.mozilla.com/D215143

By "zooming in", I mean pressing CTRL with the pref "mousewheel.with_control.action" set to 3

Also I'm not sure if it happens on other than MacOS as well

Component: Untriaged → Panning and Zooming
Product: Firefox → Core

Thank you for the report and for finding a regression window!

Keywords: regression
Regressed by: 1902017

:dlrobertson, since you are the author of the regressor, bug 1902017, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(drobertson)

Thanks for the bug report, we probably need to ignore any future momentum events on mac after a tab switch.

Flags: needinfo?(drobertson)
See Also: → 1882168

The severity field is not set for this bug.
:botond, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(botond)

Setting P2 since it's kinda new-ish regression.

Severity: -- → S3
Flags: needinfo?(botond)
Priority: -- → P2

For me it reproduces reliably. No need for any crazy switching. Just switch the tab once, then try to zoom with Ctrl+scroll (I use touchpad two-finger scroll) and it doesn't zoom the new tab, zooms the previous tab instead. OS - Linux.

Duplicate of this bug: 1918858

There are more precise reproduction steps in the duplicate bug 1918858, specifically bug 1918858 comment 5.

(In reply to Botond Ballo [:botond] from comment #10)

There are more precise reproduction steps in the duplicate bug 1918858, specifically bug 1918858 comment 5.

Iterating on this further, here are steps that reproduce the issue for me reliably on Linux:

  1. Run Firefox in a clean profile (this is important -- some addons seems to interfere with reproducibility), with MOZ_USE_XINPUT2=1 in the environment in an X11 session
  2. Open two tabs, with https://theres-waldo.github.io/mozilla-testcases/long-10000px.html in the first tab and http://example.com/ in the second
  3. Switch to the first tab. Scroll with the trackpad. Wait for the momentum scrolling to stop.
  4. Switch to the second tab with Ctrl+Tab.
  5. Try to reflow-zoom in on the second tab with Ctrl + trackpad scroll.

I believe I understand why this is happening:

  • Nothing clears InputQueue::mActivePanGestureBlock, it just gets overwritten when the next pan gesture starts
  • However, the creation of a new pan gesture block happens in InputQueue, and processing of a pan gesture input by InputQueue is conditional on mHandledByApz...
  • ... which is false for pan gesture inputs with the Ctrl key held down (because those are indeed not handled in APZ)
  • MaybeOverrideLayersIdForWheelEvent however (which was modified to also handle pan gesture inputs in the regressing bug, bug 1902017) is not conditional on mHandledByApz
  • So when the pan gesture inputs received while Ctrl is held down are processed, the function overrides the LayersId of those events to the one stored in the old pan gesture block (which is still in mActivePanGestureBlock), and the events are routed to the wrong content process
Assignee: nobody → botond
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ac40d29ea5dd Allow MockHitTester to hit layers with a LayersId other than the default of 0. r=dlrobertson https://hg.mozilla.org/integration/autoland/rev/10ebaec709a5 Do not group events which are not handled by APZ into a transaction. r=dlrobertson https://hg.mozilla.org/integration/autoland/rev/f782d2f3bb48 Avoid a debug assertion in nsBaseWidget::MayStartSwipeForAPZ(). r=dlrobertson
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
Duplicate of this bug: 1925977

(In reply to Botond Ballo [:botond] from comment #12)

  • Nothing clears InputQueue::mActivePanGestureBlock, it just gets overwritten when the next pan gesture starts

I filed bug 1933312 as a follow-up to be more proactive about clearing mActivePanGestureBlock.

Blocks: 1933312
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: