Closed Bug 1643508 Opened 6 years ago Closed 6 years ago

with apz.allow_zooming = true touch screen pinches zoom the whole page including pdf.js controls

Categories

(Firefox :: PDF Viewer, defect)

defect

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: tnikkel, Assigned: kats)

References

Details

This is basically bug 1625462 but for touchscreen pinches instead of touchpad.

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

For more information, please visit auto_nag documentation.

Flags: needinfo?(bdahl)
Severity: -- → S3
Flags: needinfo?(bdahl)

Theory: perhaps we are expecting pdf.js to preventDefault() touch events in this scenario, and it's not doing so?

pdf.js doesn't seem to handle touch events at all outside of "presentation mode". Even in presentation mode it only handles swiping (zooming is not allowed in presentation mode). So we have to implement zooming in pdf.js to make this work.

Did touchscreen pinch gestures have any effect in pdf.js with apz.allow_zooming=false?

On my Windows laptop it looks like it did reflow zoom of the entire document (including UI bits). Which seems like what I would expect.

(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #5)

On my Windows laptop it looks like it did reflow zoom of the entire document (including UI bits). Which seems like what I would expect.

Interesting. On Linux, reflowing zoom (activated via Ctrl+mousewheel) zooms the PDF content but not the controls.

Yeah that's handled by pdf.js, they preventDefault the ctrl+mousewheel and zoom the content. So it's not actually triggering browser reflow zoom. Touch doesn't dispatch mousewheel though.

Ah, I see.

So we could probably at least restore the previous behaviour (of reflow-zooming the PDF controls) by having APZ take the NotifyPinchGesture codepath for pdf.js pages (but it would require APZ knowing that it's a pdf.js page), but matching the behaviour of ctrl+mousewheel (which is to not zoom the PDF controls at all) would require changes to pdf.js like you said.

I don't think reflow zoom is a particularly useful thing to do on pdf.js because the UI ends up looking smushed. I intend to just disable all pinch behavior by calling preventDefault on the second touchstart. Eventually it could have it's own pinch zoom implementation but that seems out of scope for this bug and might require UI fiddling in pdf.js as well.

Assignee: nobody → kats

https://github.com/mozilla/pdf.js/pull/12212

I realized though that with apz.allow_zooming=true we also support the one-touch-pinch gesture, which is kind of an Android-ism that we probably don't want to have on desktop. In particular calling preventDefault() on a multi-touch touchevent doesn't prevent zooming via one-touch-pinch so it's still possible to zoom on things like pdf.js (with above PR) using the gesture. I'll file an APZ bug for that.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.