Closed Bug 1427109 Opened 6 years ago Closed 6 years ago

PDFium printing paths should not be enabled by default on Windows

Categories

(Core :: Printing: Output, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: jwatt, Assigned: u459114)

References

Details

Attachments

(1 file)

We currently shouldn't be taking any of the PDFium printing code paths introduced in bug 1399787. The define MOZ_ENABLE_SKIA_PDF is set by default in Nightly, so guarding entry into the PDFium code paths based on that define is not correct. Entry needs to be guarded by the pref print.print_via_pdf_encoder=skia-pdf.

We get this wrong it at least one place, which has resulted in bug 1425895. We should audit the use of MOZ_ENABLE_SKIA_PDF in the code landed for bug 1399787:

  hg diff -r6d431fb67f3a:972a3efac0d7
Priority: -- → P1
Assignee: nobody → cku
I guess the reason is mPrintViaSkPDF was not initiated as false.
In this push, gecko will crash if we ever try to create PrintTargetEMF
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6e1bdfa7fc3049c4ef58b91c636b58ba51ba3fa8&selectedJob=154979367

Seeing the try result, we do create PrintTargetEMF on these three platform:
Windows 10 x64 opt 	
Windows 10 x64 pgo 	
Windows 10 x64 debug

Then, I initialize mPrintViaSkPDF in the ctor of nsDeviceContextSpecWin, this problem been fixed:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=2bc037d1a2192558a1beb6b480fc7597063e7b17

So, confirm the root cause.
Attachment #8941300 - Flags: review?(jwatt)
Comment on attachment 8941300 [details]
Bug 1427109 - Initialize mPrintViaSkPDF as false to guarantee PrintTargetEMF is used only if 'print.print_via_pdf_encoder == skia-pdf'.

https://reviewboard.mozilla.org/r/211592/#review218002

Thanks, C.J.!

::: widget/windows/nsDeviceContextSpecWin.cpp:100
(Diff revision 2)
>  };
>  
>  //----------------------------------------------------------------------------------
>  nsDeviceContextSpecWin::nsDeviceContextSpecWin()
> +#ifdef MOZ_ENABLE_SKIA_PDF
> + : mPrintViaSkPDF(false)

Indent one more space, please.
Attachment #8941300 - Flags: review?(jwatt) → review+
Pushed by cku@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/179d25b30000
Initialize mPrintViaSkPDF as false to guarantee PrintTargetEMF is used only if 'print.print_via_pdf_encoder == skia-pdf'. r=jwatt
https://hg.mozilla.org/mozilla-central/rev/179d25b30000
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: