Closed Bug 923608 Opened 11 years ago Closed 2 years ago

Attempting to zoom a PDF using touch gestures results in the entire pdf.js chrome being zoomed

Categories

(Firefox :: PDF Viewer, defect, P3)

All
Windows 8
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: abcdzywx, Unassigned)

References

Details

(Whiteboard: [pdfjs-feature])

User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release)
Build ID: 20130910160258

Steps to reproduce:

Firefox on Windows 8 on a laptop with touchpad and touchscreen.  Alps touchpad.

View any PDF file.  Attempt to zoom using the touchpad using two-finger pull-apart/pull-in gestures.  Attempt to zoom using the touchscreen using the same kinds of gestures.


Actual results:

1) When attempting to zoom using two-finger gestures on the touchpad, the zooming is much too coarse-grained and flies hundreds of percentage points for each small unit of dragging.  For example, attempting to zoom in only slightly can cause the zoom factor to jump from 25% to 270%, and vice-versa.

(Note: On the contrary, zooming with the "CTRL" key and a one-finger side-scrolling gesture on the touchpad does seem to scroll at a reasonable, comfortable speed.)


2) Zooming using the touchscreen causes a different kind of zoom to occur than zooming with the touchpad, in a way that is inconsistent.  Whereas the touchpad changes the zoom of the PDF document within the frame as expected, zooming with the touchscreen causes the entire "chrome" (container) of the PDF viewer to zoom in and out.  When the latter happens, the PDF document changes zoom by a relatively small amount, and the PDF viewer "chrome" shows the same percentage of zoom for the document, but the chrome itself including the toolbar and all of the buttons get zoomed.  In addition, the focus of PDF pages does not update properly when this happens.

Zooming with the touchpad changes the zoom level shown in the PDF viewer's "chrome", i.e. has an effect equivalent to using the mouse cursor to set the zoom level in the drop-down menu or click on the "plus"/"minus" buttons.  This seems to be a desirable and expected way to zoom (notwithstanding issue #1 above).  On the other hand, I found that zooming with the touchscreen instead has the equivalent effect of changing the zoom level shown in Firefox's "View" menu, which zooms the PDF viewer toolbar and buttons, and at a faster rate than the PDF document itself changes size.  Any pages in the PDF already rendered do not update their focus, and the toolbar can become very large or very small.  This does not seem like a desirable way to zoom, unless it serves some kind of accessibility purpose (in which case this feature might not be properly tailored).


Expected results:

1) Zooming with two-finger gestures should occur with a reasonable granularity and in a way that is comfortable to the user.  It should not fly way in or way out.  (Possible suggestion to let user set granularity.)

2) Zooming with two-finger gestures on the touchscreen should perform the same, consistent operation as zooming with two-finger gestures on the touchpad.  It is probably better to have all gestures change the internal PDF document zoom as opposed to the outer "View" menu zoom (unless, perhaps, the user is given an option, with the internal zooming being the default).
Maybe needs a better component.
Component: Untriaged → PDF Viewer
Priority: -- → P3
Whiteboard: [pdfjs-c-feature]
(In reply to abcdzywx from comment #0) 
> 1) When attempting to zoom using two-finger gestures on the touchpad, the
> zooming is much too coarse-grained and flies hundreds of percentage points
> for each small unit of dragging.  For example, attempting to zoom in only
> slightly can cause the zoom factor to jump from 25% to 270%, and vice-versa.

Works fine for me. I get increments of 20 or 40 percent each time I do this. Perhaps this is an issue with the way your touchpad is configured.

Let's use this bug report to track issue 2:

> 2) Zooming using the touchscreen causes a different kind of zoom to occur
> than zooming with the touchpad, in a way that is inconsistent.

Not all possible "zoom" events are being captured by pdf.js. See also bug 786674.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hardware: x86_64 → All
Summary: FF PDF viewer zooming problems → Attempting to zoom a PDF using touch gestures results in the entire pdf.js chrome being zoomed
Version: 24 Branch → Trunk
I'm having an issue like this occur on Firefox 54 on Windows 10. When I use two fingers to zoom in or out, the whole pdf.js chrome is zoomed in/out, while the zoom setting inside pdf.js does not change.

In SeaMonkey 2.48 with the current development version of pdf.js installed as an extension from GitHub, the two-finger zoom does adjust the pdf.js zoom setting, as expected.
I was just about to raise this issue as a new bug. It's still present in the Quantum Nightlies.
Might I add, the issue is present when using pinch zoom on a touch screen also, not just the touch pad.
The root cause of this bug and bug 1177385 must be same since pinch action causes Ctrl+wheel by the mouse/touchpad utility. But perhaps, not marking it as dup of this bug makes easier to find those bug reports.
See Also: → 1177385
I think that nsDocumentViewer::SetFullZoom() dispatch "beforezoom" or something cancelable event to the window or document. Then, pdf.js handles the event and call its preventDefault().  Finally, nsDocumentViewer::SetFullZoom() skip to change zoom level of the presContext.
https://searchfox.org/mozilla-central/rev/39b790b29543a4718d876d8ca3fd179d82fc24f7/layout/base/nsDocumentViewer.cpp#3122
Whiteboard: [pdfjs-c-feature] → [pdfjs-feature]

No longer reproducible for me in recent FF versions; closing.

(In reply to James Hughes from comment #5)

Might I add, the issue is present when using pinch zoom on a touch screen
also, not just the touch pad.

Pinch zoom on my touch screen seems to do nothing at all within PDFs, at least on my machine. That's a separate bug, though.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.