Closed Bug 1664980 Opened 4 years ago Closed 4 years ago

Print preview is shown with the wrong paper size sometimes (on Windows 7)

Categories

(Core :: Print Preview, defect, P1)

Firefox 82
All
Windows 7
defect

Tracking

()

VERIFIED FIXED
Tracking Status
firefox-esr78 --- unaffected
firefox81 --- disabled
firefox82 --- fixed

People

(Reporter: asoncutean, Unassigned)

References

(Blocks 1 open bug)

Details

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

Attachments

(3 files)

Attached image screencast issue.gif

Affected versions

  • 82.0a1 (2020-09-14)

Affected platforms

  • Windows 7

Steps to reproduce

  1. Launch Firefox
  2. Make sure print.tab_modal.enabled is set on true
  3. Go to http://example.org/
  4. Hit Ctrl + P
  5. Expand More settings and select Print backgrounds
  6. Switch between Destinations

Expected result

  • The way the background is displayed stays constant

Actual result

  • The way the background is displayed varies

Regression range

Additional notes

  • The issue is intermittent and is triggered also by opening the modal several times (with the same destination), having a different outcome

Suggested severity

  • S4

Anca, can you please test with gfx.webrender.force-disabled=false?

If the issue doesn't happen with the pref setting, this issue should be a dup of either bug 1665064 or bug 1663344. (Bug 1665064 has already landed on autoland, hopefully it fixes this too!) Thanks!

Flags: needinfo?(anca.soncutean)
See Also: → 1665064, 1663344
Severity: -- → S3
Priority: -- → P2

Based on the screencast, it looks like "Save to PDF" shows one rendering and the network printer shows the other rendering -- is that right?

As far as I can tell, this seems to be sizing difference ("how much content fits on the page, and how much space is left over"). It is not a "did the background paint" difference, even though it kinda looks like that.

The website here (https://example.org) simply has a 600px-wide white-background div, centered in a <body> which has a gray background. And the GIF simply shows two legitimate layouts for that content (I'm only discussing portrait-mode, for simplicity):
*(Layout 1) With "Save to PDF" chosen, that 600px-wide-div exactly fits in the page width (or maybe it's too wide and is shrunk so that it exactly fits). This means there's no room for any gray area on the sides - the white div occupies the full width of the body.
*(Layout 2) With the network printer selected, the 600px-wide-div has more than enough space and there's room for some gray area around it (as there is when you view https://example.org in your browser.

(This would be a bit clearer if there were a border on the 600px-wide-div, probably.)

So the question here is: why are we seeing 2 different layouts? That is a bit of a mystery, since it looks like "A5/Shrink-to-fit" is chosen in both cases. Maybe the network printer simply has a higher DPI as compared to shrink-to-fit?

(The dimensions of the two purportedly-A5 pages look slightly different, too...)

Here's the piece of the screencast with "Layout 1" (where the background isn't visible at the top). You can see the rounded corners at the bottom of the white area, which is a hint that this content is simply filling the page width.

Attachment #9176942 - Attachment description: screen capture from DIV with "Save to PDF" → screen capture of "Layout 1", content fitting page & no gray on sides (with Save to PDF chosen)

So based on the pages' aspect ratios

  • "Layout 1" here (for Save to PDF) seems to legitimately be A5.
    (It's shown on a page with a ~0.70 aspect ratio, which is what A5 has, from 140x210mm. 140/210 = 0.70 approx.)
    ...BUT
  • "Layout 2" here (the network printer) is, in fact, being shown on a US Letter aspect-ratio page even though the dialog says "A5".
    (It's shown on a page with a ~0.77 aspect ratio, which is what US Letter has, from 8.5x11in. 8.5 / 11 = 0.77 approx.)

So the bug here seems to be that we're lying about the Paper Size that we're previewing, I think.

(Clearing ni from comment 1 since the question there isn't relevant at this point I think.)

Flags: needinfo?(anca.soncutean)

(For a same-units sizing comparison: A5's 140x210mm works out to roughly 5.5x8.25 in. So its longer dimension is a bit smaller than the skinnier dimension of a US Letter page. Given that: the layouts shown in the screencast are entirely reasonable -- the landscape-oriented A5 paper has a bit less width to work with than the portrait-oriented US-Letter paper, which is why there's no gray background visible in the landscape-oriented part of the screencast -- the white-backgrounded "main" div only barely fits & perhaps even has to shrink a bit.)

Anca, a few questions:
(1) Can you still reproduce this in latest Nightly?
(2) Do you know why A5 is being auto-selected as the page size when you switch printers (in your screencast)? (Is that your system/locale default somehow?)
(3) If you can still reproduce cases where the print dialog reports A5 and is showing you gray background at the top of the page ("layout 2" as in attachment 9176944 [details]): does this change if you switch to a different page layout & then switch back to A5? (I'm wondering if this is just a race condition while we set up the print-preview for a newly-selected printer, & some code isn't yet clear on what the desired page size is.)

[ni for questions in comment 7]

Flags: needinfo?(anca.soncutean)
Summary: Background is inconsistent inside print preview on Windows 7 → Print preview is shown with the wrong paper size sometimes (on Windows 7)

(Jonathan Kew mentioned some paper-size handling has changed recently, so this might be fixed?)

Putting this as P1 because it seems that it could be worse than originally described (not just background but actually wrong paper size).

Priority: P2 → P1

Hello Daniel,
Anca is on PTO right now, so I took the time to look into the issue.

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

(1) Can you still reproduce this in latest Nightly?

No, I can no longer reproduce the issue in the latest Firefox Nightly. There is no additional gray area generated above the white div when switching back to the available printer.

(2) Do you know why A5 is being auto-selected as the page size when you switch printers (in your screencast)? (Is that your system/locale default somehow?)

My intuition tells me that she has that set up either in the modal window or at the printer level.
While switching to 'save to pdf' indeed does set the paper size to A5, switching back to the available printer reverts the size back to what the printer has the default set as (if it had a different size).

Flags: needinfo?(anca.soncutean)

Thanks, Cristian! Sounds like perhaps this has been fixed, then? (or at least, we're not sure whether it's still reproducible)

Let's see if Anca can still reproduce when she's back from PTO; and if not, then it's likely this has been fixed by one of the changes that's been made in the time since the bug was filed.

Anca, are you also able to confirm?

Flags: needinfo?(anca.soncutean)

Hi,

I was able to verify that the bug was fixed on Nightly version 83.0a1 (2020-09-26) (64-bit) on windows 7. (I first reproduced the bug on Nightly version from September 14th). I didn't change the flags because I wasn't sure if that was ok.

Regards, Flor.

Sounds like we can close this. But we should verify if this was fixed in 82 beta since we plan to ship the feature first there as an experiment first (seems likely since we've been uplifting most patches).

Flor, would you mind testing the latest 82Beta on Win7, to verify that this is fixed there?

Flags: needinfo?(fdiciocco)

Sure, give me some time to get the machine running and I'll test it.

Hi, so I tested it in 82.0b5 (64 and 32 bit) and it worked ok, it was fixed there too.

Regards, Flor.

Flags: needinfo?(fdiciocco)
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Flags: needinfo?(anca.soncutean)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: