Closed Bug 1961414 Opened 24 days ago Closed 19 days ago

pdf.js ctrl + scroll: zoom by hotkey not working most of the time

Categories

(Firefox :: PDF Viewer, defect)

Desktop
Unspecified
defect

Tracking

()

RESOLVED DUPLICATE of bug 1957680

People

(Reporter: felix.bau, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:137.0) Gecko/20100101 Firefox/137.0

Steps to reproduce:

I just noticed an annoying bug in Firefox's pdf viewer component on Windows 11 64bit:
Open any pdf in Firefox for example https://www.orimi.com/pdf-test.pdf
keep scrolling the page up and down with your mouse
then press ctrl and let it loose repeatedly.

This is the same bug as 1939219: https://bugzilla.mozilla.org/show_bug.cgi?id=1939219
But I did some regression testing. The behavior is indeed random, but most of the time, zoom isn't working at all when using these hotkey, while it works fine every time on normal webpages. This also affects pdf.js being embedded into a page like here: https://fcc.report/FCC-ID/SWX-NBE5ACG2W/3546405
Works fine on the webpage but it's broken in the iframe.
One thing I noticed: Pressing the scroll wheel once and then left clicking afterwards (left click to stop the scroll mode) immediately fixes the bug and let's me zoom in. But the issue reappears once I stop holding ctrl and press it again. (sometimes it takes a few times of toggling ctrl but usually it's immediatly broken again)

Actual results:

Often nothing happens instead of zoom, while ctrl is pressed. (doesn't matter whether ctrl left or ctrl right)
The page scrolls fine while ctrl isn't pressed, and it doesn't scroll while ctrl is pressed. Therefore scroll as well ctrl are recognized correctly by Firefox. (ctrl prevents scrolling like it is supposed to)

Expected results:

ctrl+scroll up should zoom in
ctrl+scroll down should zoom out

Regression testing:
The bug appeared first on nightly 2016-04-08
Tested mozilla-central build: 2016-04-07 (verdict: g) good
Tested mozilla-central build: 2016-04-08 (verdict: b) bad

It wasn't as bad then, because if you kept scrolling, it would work eventually.
Hold ctrl and scroll: at first it doesn't register but after one or two seconds it starts zooming in/out. So the bug wasn't catched back then.

The bug regressed and got worse though:
Tested mozilla-central build: 2024-02-28 (verdict: g) good
Tested mozilla-central build: 2024-02-29 (verdict: b) bad
Ever since last year, nightly 2024-02-29, even if you keep on scrolling while holding ctrl, it won't register zooming in/out at all anymore. You have to toggle CTRL 10 times or more to get it to work at times. As said above a workaround for now is to click the scroll wheel. That fixes the bug once, but it's not an intuitive workaround, but might help in debugging the race condition that this is caused by. Pressing scroll wheel probably resets the viewport somehow, so the next iteration of ctrl + zoom works fine, while all subsequent iterations fail most of the time.

Using "debug" instead of "shippable" as mozregression's build type: lots of builds were skipped but it identified this commit as the regression, which seems unlikely but probably other builds might not exist so it happened due to this commit or a slightly earlier commit:
Bug 1839039 - Fix download foreground service crash for SDK 31 and above r=android-reviewers,amejiamarmol,mcarare

side node:
For the actual bug I was only able to identify the day, because taskcluster builds only go back one year. This also means you can only redo my testing on build type "debug" in mozregression for another 10 days after this bug report is opened.

I will attach a video later showcasing the bug. (before and after and the regression)
I'm going to test Debian next, because this might be an OS specific bug

I just noticed that activating smooth scrolling has quite an effect on the bug.
Now it almost always works correctly, unless I click the scroll wheel and scroll by moving the mouse. then it is broken again afterwards: zoom does not work, unless I use left click on the mouse once then it's working again.
Interesting since it almost feels like the opposite behavior.

The Bugbug bot thinks this bug should belong to the 'Firefox for Android::General' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → General
Product: Firefox → Firefox for Android

On Windows 11 64bit I tested current release 137.0.2 as well as the latest nightly 139.0a1 (2025-04-18) (64-Bit)

Debian 12 Bookworm is affected, too (128.7.0esr 64bit as well as 128.9.0esr 64bit)
I had to disable smooth scrolling though (not sure if that's the default on Linux or whether it was my personal preference).

The tests on Windows 11 and Debian 12 were run on different hardware, except the mouse which was the same.

also important: autoscrolling needs to be activated in order for the workaround to actually work (pressing the scroll wheel and then clicking afterwards to exit autoscrolling)

I know, I already wrote this above, but since the report is getting quite long, I'll repeat this:
the bug only happens on PDF documents loaded in Firefox (pdf.js), it does not affect scroll zooming on normal web pages

Component: General → PDF Viewer
Product: Firefox for Android → Firefox
Hardware: Unspecified → Desktop

Hello, thank you for the bug report!
I managed to reproduce your issue, however, I believe it is a duplicate of bug 1957680 and shall mark it as such.
Please track this issue in bug 1957680 , thank you.

Status: UNCONFIRMED → RESOLVED
Closed: 19 days ago
Duplicate of bug: 1957680
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.