Closed Bug 1260413 Opened 8 years ago Closed 8 years ago

Page dimensions aren't passed to print preview when printing via the parent

Categories

(Core :: Print Preview, defect)

All
Windows
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
firefox49 --- fixed

People

(Reporter: r.chrzanowski, Unassigned)

References

Details

(Whiteboard: sbwc1)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160325030241

Steps to reproduce:

1. Create preferences:
print.printer_PDFCreator.print_headercenter = "header"
print.printer_PDFCreator.print_paper_height = 400
print.printer_PDFCreator.print_paper_width = 400
print.printer_PDFCreator.print_paper_size_unit = 1
print.printer_PDFCreator.print_paper_name = "name"

where PDFCreator is your default printer name

2. Open print preview (from Firefox menu) in e10s window

3. Open print preview (from Firefox menu) in non-e10s window


Actual results:

In non-e10s the preview shows a page with a custom header and custom dimensions.
In e10s the preview shows a page with a custom header but default dimensions.


Expected results:

Both previews should have shown a page with custom dimensions.
Component: Untriaged → Print Preview
Product: Firefox → Core
Blocks: e10s
Flags: needinfo?(bobowen.code)
Summary: Page dimensions aren't passed to print preview in e10s → [e10s] Page dimensions aren't passed to print preview in e10s
This only happens when printing via the parent, so shouldn't block e10s, but should block first roll out of sandboxing.

The problem is down to the initialisation of the nsDeviceContextSpecWin going through a different code path for print preview than print.

This means that even though the print settings haven't been set up properly for print preview, it falls back to code that re-pulls the settings from the printer using the settings from the prefs.
On this occasion it updates the print settings from the DEVMODE, but it doesn't before that.

When printing via the parent nsDeviceContextSpecProxy expects the print settings to be set up already, so I need to fix that.

The whole print settings set up is a bit weird.
For print preview in non-e10s it reads the settings from the prefs and printer three times.
As far as I can tell, the last time is after the surface for the print preview has actually been created.
Blocks: 1238964
No longer blocks: e10s
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(bobowen.code)
Summary: [e10s] Page dimensions aren't passed to print preview in e10s → Page dimensions aren't passed to print preview when printing via the parent
Whiteboard: sbwc1
Looks like I fixed this as a result of the change in bug 1255336.

Would mind testing this as well in the latest Nightly?

Bug 1255336 has already been uplifted, so this should be in the next Beta and Dev Edition.
Depends on: 1255336
Flags: needinfo?(r.chrzanowski)
It seems ok now, thank you.
(In reply to r.chrzanowski from comment #3)
> It seems ok now, thank you.

Thanks again for reporting and testing this and the other bugs.
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(r.chrzanowski)
OS: Unspecified → Windows
Hardware: Unspecified → All
Resolution: --- → FIXED
Version: 47 Branch → Trunk
You need to log in before you can comment on or make changes to this bug.