Closed Bug 1663448 Opened 4 years ago Closed 4 years ago

Pdf content broken in print preview when toggling orientation mode

Categories

(Toolkit :: Printing, defect, P2)

Firefox 82
defect

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox80 --- unaffected
firefox81 --- unaffected
firefox82 --- fixed

People

(Reporter: asoncutean, Assigned: emilio)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: [print2020_v82][old-ui-])

Attachments

(3 files)

Attached image screencast issue.gif

Affected versions

  • 82.0a1 (2020-09-07)

Affected platforms

  • Ubuntu 18.04
  • Windows 10
  • macOS 10.14

Steps to reproduce

  1. Launch Firefox
  2. Make sure print.tab_modal.enabled is set on true
  3. Open https://www.irs.gov/pub/irs-pdf/f1040.pdf
  4. Hit Ctrl + P
  5. Switch between Landscape and Portrait mode

Expected result

  • The print preview content adjusts according to the orientation mode changing

Actual result

  • The print preview content is broken

Regression range

Additional notes

  • Not reproducible with old ui

**Suggested severity

  • S3

NI Emilio so he's also aware, since he's been working on the PDF printing codepath.

Flags: needinfo?(emilio)
Priority: -- → P2
Regressed by: 1662914
Has Regression Range: --- → yes

Note that I think the PDF content is also brokenly rendered before bug 1662914 in a different way. Before bug 1662914, the broken page is not scaled but isn't fully rendered.

Yeah, brendan can confirm, but from the code I don't think pdf.js has any way to react to the paper orientation at all. If only the new rendering should be slightly more correct.

Flags: needinfo?(emilio) → needinfo?(bdahl)

Oh, I see what happens now. I think some code in pdf.js is not dealing with resetting the canvas state properly. So we cancel the render operation but when we re-run it it runs with old state which causes some of the weirdness I think.

See Also: → 1662373
Whiteboard: [print2020_v81] [old-ui-] → [print2020_v82][old-ui-]
Severity: -- → S3

I'll try to poke at this.

Flags: needinfo?(emilio)
See Also: → 1664178

I did leave a comment in bug 1664178 comment 3 what's wrong there, FWIW.

Attached file PDF.js PR
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(emilio)
Flags: needinfo?(bdahl)

Self-reminder to fix the issues that that PR has.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)

Ryan, we need https://github.com/mozilla/pdf.js/pull/12369 in our tree to fix this and bug 1664178. Is there any chance you could take care of updating pdf.js?

Flags: needinfo?(ryanvm)

(No rush, when possible... this only affects significantly the new UI)

We did one earlier today, unfortunately prior to this PR being merged upstream. It'll be in the next one some time later this week.

Flags: needinfo?(ryanvm)
Depends on: 1665812

Marking as fixed by bug 1665812.

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

Attachment

General

Created:
Updated:
Size: