Closed Bug 1787456 Opened 2 years ago Closed 2 years ago

Scrolling is not working on pdfs inside presentation mode

Categories

(Firefox :: PDF Viewer, defect)

defect

Tracking

()

VERIFIED FIXED
106 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 --- unaffected
firefox104 --- wontfix
firefox105 --- verified
firefox106 --- verified

People

(Reporter: cgeorgiu, Assigned: Snuffleupagus)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files, 1 obsolete file)

Found in

  • Beta 105.0b3

Affected versions

  • Release 104.0
  • Beta 105.0b3
  • Nightly 106.0a1

Tested platforms

  • Affected platforms: Windows 10 x64, macOS 11
  • Unaffected platforms: Ubuntu 20.04 x64

Steps to reproduce

  1. Launch Firefox.
  2. Navigate to http://www.pdf995.com/samples/pdf.pdf.
  3. Enter into presentation mode, and start scrolling via space bar, page up/down or home/end keys from the keyboard.

Expected result

  • The scrolling is working in every case.

Actual result

  • The scrolling is not working at all.

Regression range

  • This seems to be a regression as I cannot reproduce the problem on Release 103.0. I'll investigate further in order to find a regression range.

mozregression gives the following pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=5da16396fa22b03b190b7d87f597ab11fa810b1d&tochange=cfcf61dedb350b96952a742d0466de479c17aa4e

Setting dom.fullscreen.modal = false in about:config also "fixes" things, which thus confirms the regressing bug found above.

Note that the PDF Viewer uses "keydown" events to handle page-switching in Fullscreen-mode, and it appears that those events are no longer being dispatched after bug 1771150.
:emilio, can you please help out here?

Flags: needinfo?(emilio)
Regressed by: 1771150

Set release status flags based on info from the regressing bug 1771150

When entering in fullscreen mode in using the button, this one is "stealing" the focus, hence a way to fix this issue is to add an evt.preventDefault():
https://github.com/mozilla/pdf.js/blob/76f665d57fab7da08445a56c1b36fd746887ee75/web/toolbar.js#L158
but in a mousedown listener.

(In reply to Calixte Denizet (:calixte) from comment #3)

When entering in fullscreen mode in using the button, this one is "stealing" the focus, hence a way to fix this issue is to add an evt.preventDefault():
https://github.com/mozilla/pdf.js/blob/76f665d57fab7da08445a56c1b36fd746887ee75/web/toolbar.js#L158
but in a mousedown listener.

If in the end we need to work-around this on the PDF.js side of things, which isn't entirely clear to me (hopefully Emilio can chime in here), then a much smaller/simpler way to fix this would probably be to have the PresentationMode-code invoke this method instead.

Yeah, so this is technically bug 1740989 (we should blur the element when it becomes non-focusable). I took a quick look and it seems https://github.com/whatwg/html/issues/8225 would be great to get sorted out at least before implementing that.

The workaround being trivial seems worth landing / uplifting for now tho. Can anyone test Safari? My understanding is that they don't implement this either and should behave the same way we do...

Flags: needinfo?(emilio)
See Also: → 1740989
Has STR: --- → yes
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Assignee: nobody → jonas.jenwald
Target Milestone: --- → 106 Branch
Attachment #9292766 - Attachment is obsolete: true

The patch landed in nightly and beta is affected.
:Snuffleupagus, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox105 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(jonas.jenwald)

A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)

Comment on attachment 9292765 [details]
Bug 1787456 - Always focus the viewerContainer when entering PresentationMode. r?#release-managers!

Beta/Release Uplift Approval Request

  • User impact if declined: Keyboard scrolling is broken in PresentationMode in the PDF Viewer.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Please see https://bugzilla.mozilla.org/show_bug.cgi?id=1787456#c0
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): It's a single line of added JS-code, inside of a try-catch block. The function being called is also used elsewhere in the PDF Viewer and has existed for many years.
  • String changes made/needed: N/A
  • Is Android affected?: No
Flags: needinfo?(jonas.jenwald)
Attachment #9292765 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Comment on attachment 9292765 [details]
Bug 1787456 - Always focus the viewerContainer when entering PresentationMode. r?#release-managers!

Approved for 105.0b7.

Attachment #9292765 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Verified as fixed in Beta 105.0b7 and our latest Nightly build 106.0a1 (2022-09-04) on both platforms.

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

Attachment

General

Created:
Updated:
Size: