Closed Bug 1983147 Opened 1 year ago Closed 1 year ago

Print preview doesn't show some pages when printing a pdf

Categories

(Core :: Print Preview, defect, P2)

defect

Tracking

()

RESOLVED FIXED
144 Branch
Tracking Status
firefox-esr128 --- unaffected
firefox-esr140 --- unaffected
firefox141 --- unaffected
firefox142 --- unaffected
firefox143 + verified
firefox144 --- verified

People

(Reporter: calixte, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 1 external file)

Attached file tracemonkey.pdf —

STR:

  • open the pdf
  • print it

In the print preview, the four first pages are empty and when scrolling back to the first one then the first page is rendered correctly.
Some pages are partially rendered.

In using mozregression, I found that this regression is because of bug 1981748.

Flags: needinfo?(emilio)

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

[Tracking Requested - why for this release]: PDF print preview regression

Just to confirm, this is just about the print preview right? Does printing (well, saving to pdf) produce the right output?

Severity: -- → S2
Component: Printing: Output → Print Preview
Priority: -- → P2
Flags: needinfo?(cdenizet)

Yep it's just about the preview: saving to pdf is fine.

Flags: needinfo?(cdenizet)

After bug 1981748, display items have the page number stored in the
per-frame key when printing.

This code was assuming that the per-frame key was just the display item
type, which is an assumption that no longer holds.

Invalidate all the relevant display items. I think this might have been
a pre-existing issue, if you had a canvas that could overflow into the
next page. However I believe to hit this you need mozPrintCallback so
maybe we just never hit this...

Not sure how to write a test given the need for mozPrintCallback, but
can try...

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/77f43aca027e https://hg.mozilla.org/integration/autoland/rev/3bdaa2f4c322 Fix WebRender canvas content invalidation when printing. r=tnikkel,layout-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
Duplicate of this bug: 1984051

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

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

Comment on attachment 9507540 [details]
Bug 1983147 - Fix WebRender canvas content invalidation when printing. r=tnikkel

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: Regression in pdf print preview.
  • 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: comment 0
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Worst case we over-invalidate.
  • String changes made/needed: none
  • Is Android affected?: Yes
Flags: needinfo?(emilio)
Attachment #9507540 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Comment on attachment 9507540 [details]
Bug 1983147 - Fix WebRender canvas content invalidation when printing. r=tnikkel

Approved for 143.0b3.

Attachment #9507540 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [uplift] [qa-ver-needed-c144/b143]
QA Contact: gmoldovan

Reproduced the issue on an affected Nightly build from 2025-08-14.

Verified as fixed on the latest Nightly 144.0a1 (20250824214058) and Beta 143.0b3 (20250822090535) using Windows 10, Ubuntu 22, and macOS 13. In these builds, the problem is no longer reproducible:

  • All pages are rendered correctly in print preview.
  • No empty or partially rendered pages appear when scrolling through the preview.

Marking the issue as verified fixed.

Has STR: --- → yes
QA Whiteboard: [uplift] [qa-ver-needed-c144/b143] → [uplift] [qa-ver-needed-c144/b143] [qa-ver-done]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: