Closed Bug 1257825 Opened 4 years ago Closed 4 years ago

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

Categories

(Core :: Printing: Setup, defect)

46 Branch
All
Windows
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox46 --- fixed
firefox47 --- fixed
firefox48 --- fixed

People

(Reporter: bobowen, Assigned: bobowen)

References

Details

Attachments

(1 file)

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.
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+
https://hg.mozilla.org/mozilla-central/rev/1a47789d4d15
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
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 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+
You need to log in before you can comment on or make changes to this bug.