Getting gfx errors from setting a -1 for PaperWidth and PaperHeight

RESOLVED FIXED in Firefox 46

Status

()

Core
Printing: Setup
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: bobowen, Assigned: bobowen)

Tracking

46 Branch
mozilla48
All
Windows
Points:
---

Firefox Tracking Flags

(firefox46 fixed, firefox47 fixed, firefox48 fixed)

Details

Attachments

(1 attachment)

Looks like gfxCriticalErrors were added to the print settings for this as a belt and braces approach to fixing a crash in bug 1019063.

-1 is now used on Windows to indicate that the print device didn't set a page width or height, which often happens when a paper size is selected.

This is causing spurious errors to appear in about:support when you print.
Created attachment 8732237 [details] [diff] [review]
Remove checks for paper height and width <= 0 in nsPrintSettings

Also added the check for invalid width / height into nsDeviceContextSpecProxy that was added into nsDeviceContextSpecWin.
Attachment #8732237 - Flags: review?(dvander)
Comment on attachment 8732237 [details] [diff] [review]
Remove checks for paper height and width <= 0 in nsPrintSettings

Review of attachment 8732237 [details] [diff] [review]:
-----------------------------------------------------------------

::: widget/nsDeviceContextSpecProxy.cpp
@@ +68,5 @@
>    MOZ_ASSERT(mRealDeviceContextSpec);
>  
>    double width, height;
>    nsresult rv = mPrintSettings->GetEffectivePageSize(&width, &height);
> +  if (NS_WARN_IF(NS_FAILED(rv)) || width <= 0 || height <= 0) {

These checks should still be valid, right?
Comment on attachment 8732237 [details] [diff] [review]
Remove checks for paper height and width <= 0 in nsPrintSettings

Review of attachment 8732237 [details] [diff] [review]:
-----------------------------------------------------------------

Err sorry ignore that, I read the diff backwards :)

r=me
Attachment #8732237 - Flags: review?(dvander) → review+

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/1a47789d4d15
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox48: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Comment on attachment 8732237 [details] [diff] [review]
Remove checks for paper height and width <= 0 in nsPrintSettings

Approval Request Comment
[Feature/regressing bug #]:
Bug 1238964.

[User impact if declined]:
Causes incorrect gfx critical errors to be reported in about:support when printing.

[Describe test coverage new/current, TreeHerder]:
Print preview tests should exercise the print settings code.
Also tested manually.

[Risks and why]: 
Low - just removes two checks that only reported and didn't affect behaviour. Also adds new check into code that is only currently used on Nightly.

[String/UUID change made/needed]:
None.
Attachment #8732237 - Flags: approval-mozilla-beta?
Attachment #8732237 - Flags: approval-mozilla-aurora?

Comment 8

2 years ago
Comment on attachment 8732237 [details] [diff] [review]
Remove checks for paper height and width <= 0 in nsPrintSettings

Low risk fix that was verified manually, taking it. Aurora47+, Beta46+
Attachment #8732237 - Flags: approval-mozilla-beta?
Attachment #8732237 - Flags: approval-mozilla-beta+
Attachment #8732237 - Flags: approval-mozilla-aurora?
Attachment #8732237 - Flags: approval-mozilla-aurora+

Comment 9

2 years ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-aurora/rev/b39f70d900f7
status-firefox47: affected → fixed

Comment 10

2 years ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-beta/rev/456366b1ff23
status-firefox46: affected → fixed
You need to log in before you can comment on or make changes to this bug.