Closed Bug 1919414 Opened 2 years ago Closed 1 year ago

Pages-per-sheet count is double-applied (squared), if you print via system print dialog

Categories

(Core :: Printing: Setup, defect)

Desktop
Linux
defect

Tracking

()

VERIFIED FIXED
135 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- verified
firefox130 --- wontfix
firefox131 --- wontfix
firefox132 --- wontfix
firefox133 --- wontfix
firefox134 --- wontfix
firefox135 --- verified
firefox136 --- verified

People

(Reporter: dholbert, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 1 external file)

STR:

  1. Load attached testcase (a 2-page document) in Firefox Nightly on Linux, using a fresh profile
  2. Ctrl+P
  3. Choose "Print using the System Print Dialog"
  4. Click the "Page Setup" tab and choose "Pages-per-side: 2" and then proceed with your print operation. (Note: this probably requires a real printer -- Pages-per-side isn't available in the system print dialog if you're using the "Print to file" print target)
  5. Click "Print" and look at the results.

EXPECTED RESULTS:
The printout should have a 2-pages-per-sheet layout (with my 2 portrait pages side by side, filling a landscape-orientation sheet).

ACTUAL RESULTS:
The printout has a 4-pages-per-sheet layout (with my 2 portrait-oriented pages side-by-side at the top of a portrait-oriented sheet, with the bottom half blank [or filled in with more pages if you perform these STR with a longer document].)

mozregression range:
Last good revision: 7ff758e0d08b4bdf0ce3bd2abe84a1bff3be8ff4 (2022-12-14)
First bad revision: 440856ffde519ea98b6c1fca7d461c20cc55a90c (2022-12-15)
Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=7ff758e0d08b4bdf0ce3bd2abe84a1bff3be8ff4&tochange=440856ffde519ea98b6c1fca7d461c20cc55a90c

In that range, I think this would have been from bug 1805716 -- that's the only print-related change in there.

There's also an interesting connection here to bug 1755974 whose patch coincidentally landed on the previous day (just before the regression range) -- at first I suspected that as the regressor, but now I don't since its patch was included in the "last-good" build here. I'll post more notes about that one in another comment so that this initial one isn't too long.

Attachment #9425440 - Attachment description: testcase 1 (simple 2-page document) → testcase 1 (simple 2-page document with just a solid border around the whole body)

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

:jwatt, since you are the author of the regressor, bug 1805716, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

(In reply to Daniel Holbert [:dholbert] from comment #0)

There's also an interesting connection here to bug 1755974 whose patch coincidentally landed on the previous day (just before the regression range) -- at first I suspected that as the regressor, but now I don't since its patch was included in the "last-good" build here. I'll post more notes about that one in another comment so that this initial one isn't too long.

Following up on this: I think the patch that we landed in bug 1755974 didn't actually fix it, and then the patch we landed in bug 1805716 made it reproduce more readily.

To illustrate this, I tested 3 consecutive Nightlies:

  • 2022-12-13 (baseline)
  • 2022-12-14 (includes the patch that landed for bug 1755974)
  • 2022-12-15 (includes the patch that landed for bug 1805716)

...and I tested each of those in 3 situations, printing the attached testcase (I'm listing an abbreviation for each, for the benefit of the results-table below):

  • A.PPS-in-Firefox: set "pages-per-sheet:2" in Firefox's own print dialog, and then click out to System Print Dialog and proceed with the print.
  • B.PPS-in-System: leave "pages-per-sheet" at the default 1 in Firefox's own print dialog, and then click out to System Print Dialog and choose "Pages-per-side: 2" (in Page Setup tab) and then print.
  • C.PPS-in-Both: set pages-per-sheet to 2 in Firefox's own print dialog, then click out to system print dialog and set it to 2 there as well, and then Print.

Here are the results (the pages-per-sheet count we actually render with):

                     A.PPS-in-Firefox  B.PPS-in-System  C.PPS-in-Both
Nightly 2022-12-13          2                 2               4
Nightly 2022-12-14          2                 2               4
Nightly 2022-12-15          4                 4               4

So: Nightly 2022-12-13 and 2022-12-14 give the same results, which lead me to believe bug 1755974's patch didn't actually help, unfortunately. (I would have expected it to drop the page-count to 2 in situation C.)

And Nightly 2022-12-15 gives 4 pages across the board, but that's because A/B/C are all essentially the same situation there, because starting with that Nightly, we copy the settings from Firefox's print dialog to the system-print dialog. (So setting pages-per-sheet:2 in Firefox's print dialog means we automatically show pages-per-sheet:2 in the system print dialog as well.)

FWIW this bug came across my radar because someone requested the ability to do 2-pages-per-sheet with reversed page-ordering:
https://connect.mozilla.org/t5/ideas/add-pdf-page-order-setting-when-printing/idi-p/70668

That reversed-order feature is arguably in the category of rarely-used-power-features that we can let users find in the system print dialog if they really need it, in the interests of keeping Firefox's own print dialog easy-to-use and uncluttered. (Pages-per-sheet itself is rarely-used; and reverse-order-pages-per-sheet is presumably even more of a niche thing.) And on Linux at least, there is a reversed-page-ordering feature available in the system print dialog (nice!), and it works as-expected in Nightly 2022-12-13 and 2022-12-14 (hooray!), but it's not really usable in Nightlies after that point, due to this bug here -- since just using the system print dialog at all causes the pages-per-sheet count to be applied twice, i.e. squared.

Summary: Pages-per-sheet count is doubled, if you set it in system print dialog → Pages-per-sheet count is double-applied (squared), if you set it in system print dialog

Triaging as S3 given that this doesn't affect our built-in print dialog, and it's probably linux-specific, and we've been shipping for years without anyone noticing. :)

Still feels pretty broken & like something we should fix soonish, though.

Severity: -- → S3

[clarifying bug title -- in current Nightly (and really any Nightly after 2022-12-15), this bug reproduces regardless of whether you choose 2-pages-per-sheet in the Firefox print dialog vs. the system print dialog. All that matters is that you chose 2 pages per sheet somewhere, and that you actually choose a real or real-enough CUPS printer (not the "Print to File" special print target in the system print dialog).]

Summary: Pages-per-sheet count is double-applied (squared), if you set it in system print dialog → Pages-per-sheet count is double-applied (squared), if you print via system print dialog

Clearing ni=jwatt since I don't think the regression status means he needs to change course & jump on this [as bugbot semi-assumes by default].

Ideally someone with print-internals knowledge (which could be either of two or another teammate) should take a look here before too long though.

Flags: needinfo?(jwatt)

I tested to be sure this doesn't repro on macOS or Windows, and this particular issue doesn't repro, but it turns out we hit different bugs (about page-orientation) if I perform the STR there. I filed those as:
on mac: bug 1919917
on windows: bug 1919925

Duplicate of this bug: 1938262
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/32adfbef0de1 Don't use Gecko's pages per sheet code in the native print dialog. r=dholbert
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch

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

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

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Flags: qe-verify+

I can verify that using the steps in comment 0, the printer will print 2 portrait pages on a landscape-oriented sheet of papper, as expected. This has been verified in Ubuntu 22 in the Nightly v135.0a1 and Beta v135.0b4. Closing as verified. Thank you.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
OS: Unspecified → Linux
Hardware: Unspecified → Desktop

This seems worth fixing for ESR users and grafts cleanly. Please nominate for uplift unless you feel strongly otherwise :-)

Flags: needinfo?(emilio)

Comment on attachment 9444554 [details]
Bug 1919414 - Don't use Gecko's pages per sheet code in the native print dialog. r=dholbert,jwatt

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: see above
  • User impact if declined: comment 0
  • Fix Landed on Version: 135
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Simple fix
Flags: needinfo?(emilio)
Attachment #9444554 - Flags: approval-mozilla-esr128?

Comment on attachment 9444554 [details]
Bug 1919414 - Don't use Gecko's pages per sheet code in the native print dialog. r=dholbert,jwatt

Approved for 128.7esr.

Attachment #9444554 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128+

This fix has also been verified in Firefox ESR v128.7.0esr on Ubuntu 22.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: