Closed Bug 1658173 Opened 4 years ago Closed 4 years ago

Scale down print preview so that a single page fits vertically *and* horizontally

Categories

(Core :: Print Preview, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

(Whiteboard: [print2020_v81])

Attachments

(7 files)

In bug 1651947, we fixed up print-preview scaling so that a single page will fit, horizontally.

We should take this a step further, to make sure a page fits horizontally and vertically. Otherwise, we're at risk of having a nearly-useless scrollbar from a single-page document that barely overflows the scrollport. (See the lower arrow in attachment 9167767 [details])

Severity: -- → S3
Type: task → enhancement
Priority: -- → P3
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Whiteboard: [print2020] → [print2020_v81]

Note: Previously we were scaling based on the available ISize (and we were
ignoring the BSize for scaling purposes). Now we want to consider the BSize as
well, so the obvious next step would be to scale based on the available BSize -
but that doesn't work, because the available BSize is unconstrained here. (It's
unconstrained, even though we're fragmenting, because thankfully we don't
attempt to fragment the nsPageSequenceFrame itself -- we only fragment at a
level further down in the frame tree.)

So: this patch changes us to instead scale down based on the computed size
(rather than the available size), such that both dimensions fit. The computed
size here is the size of the scrollport; and, importantly, it has a finite
value in the block axis (unlike the available BSize which is unconstrained
here).

Note that the available ISize and the computed ISize are the same in this case
(they're both the ISize of the scrollport), so there's no behavior-change here
for the computation of the inline-axis-based scale factor.

Attachment #9169940 - Attachment description: Bug 1658173: Scale down print-preview so that an entire sheet fits into the scrollport, in both dimensions (not just the inline axis). → Bug 1658173: Scale down print-preview so that an entire sheet fits into the scrollport, in both dimensions (not just the inline axis). r?emilio

Screenshots attached showing the new & better look with the patch.

(The old and not-as-good lock, without the patch (in current Nightly) uses a larger scale for the portrait-mode scenarios here, such that the width fits exactly but the bottom is clipped off, as shown in e.g. attachment 9167767 [details].)

Attachment #9169940 - Attachment description: Bug 1658173: Scale down print-preview so that an entire sheet fits into the scrollport, in both dimensions (not just the inline axis). r?emilio → Bug 1658173: Scale down print-preview so that every sheet fits into the scrollport, in both dimensions (not just the inline axis). r?emilio
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b21c793d9d52
Scale down print-preview so that every sheet fits into the scrollport, in both dimensions (not just the inline axis). r=emilio

Backed out changeset b21c793d9d52 (bug 1658173) for test_printpreview.xhtml failures.

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&searchStr=os%2Cx%2C10.14%2Cdebug%2Cmochitests%2Cwithout%2Ce10s%2Ctest-macosx1014-64%2Fdebug-mochitest-chrome-1proc%2Cc2&fromchange=5a258bf5a02bfc3795e213df9f9af2f09ddf588e&tochange=1937aef58aa6061225b951f2c50bf6bea4d319ae&selectedTaskRun=VP1Gh8z5ROSKQjKh9_B6IA.0

Backout link: https://hg.mozilla.org/integration/autoland/rev/1937aef58aa6061225b951f2c50bf6bea4d319ae

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=313087162&repo=autoland&lineNumber=117551

[task 2020-08-15T01:12:11.823Z] 01:12:11     INFO - TEST-START | layout/base/tests/chrome/test_printpreview.xhtml
[task 2020-08-15T01:12:11.957Z] 01:12:11     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootFrame) failed: file /builds/worker/checkouts/gecko/dom/base/nsGlobalWindowOuter.cpp, line 4248
[task 2020-08-15T01:12:12.156Z] 01:12:12     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:12.182Z] 01:12:12     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:12.373Z] 01:12:12     INFO - GECKO(2457) | JavaScript error: chrome://mochitests/content/chrome/layout/base/tests/chrome/printpreview_helper.xhtml, line 142: ReferenceError: counterTimeout is not defined
[task 2020-08-15T01:12:12.373Z] 01:12:12     INFO - GECKO(2457) | [2457, Main Thread] WARNING: 'aOwner->IsDiscarded()', file /builds/worker/workspace/obj-build/dist/include/mozilla/dom/SyncedContextInlines.h, line 36
[task 2020-08-15T01:12:12.373Z] 01:12:12     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(presShell) failed: file /builds/worker/checkouts/gecko/dom/base/nsGlobalWindowOuter.cpp, line 4246
[task 2020-08-15T01:12:12.376Z] 01:12:12     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Failed to retarget HTML data delivery to the parser thread.: file /builds/worker/checkouts/gecko/parser/html/nsHtml5StreamParser.cpp, line 1131
[task 2020-08-15T01:12:12.680Z] 01:12:12     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(currentInner) failed: file /builds/worker/checkouts/gecko/dom/base/WindowDestroyedEvent.cpp, line 106
[task 2020-08-15T01:12:14.340Z] 01:12:14     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:14.341Z] 01:12:14     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:14.381Z] 01:12:14     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:14.381Z] 01:12:14     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:15.042Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:15.067Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:15.083Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:15.093Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:15.239Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:15.239Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:15.274Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:15.274Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:15.474Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:15.478Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:15.611Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:15.617Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:15.860Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:15.869Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:15.890Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:15.897Z] 01:12:15     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:16.042Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:16.042Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:16.058Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:16.063Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:16.334Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:16.334Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:16.362Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:16.362Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:16.564Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:16.589Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:16.622Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:16.622Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:16.881Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:16.881Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:16.909Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:16.909Z] 01:12:16     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:17.094Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:17.094Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:17.124Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:17.124Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:17.257Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:17.258Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:17.292Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:17.293Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:17.482Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:17.482Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:17.505Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:17.510Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:17.546Z] 01:12:17     INFO - TEST-INFO | started process screencapture
[task 2020-08-15T01:12:17.642Z] 01:12:17     INFO - TEST-INFO | screencapture: exit 0
[task 2020-08-15T01:12:17.642Z] 01:12:17     INFO - <snipped 114 output lines - if you need more context, please use SimpleTest.requestCompleteLog() in your test>
[task 2020-08-15T01:12:17.645Z] 01:12:17     INFO - Buffered messages logged at 01:12:16
[task 2020-08-15T01:12:17.646Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.646Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.648Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.648Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.648Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.648Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.648Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.648Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.648Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.648Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.648Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.648Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.652Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.652Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.652Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.653Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Comparing print preview didn't succeed [<input type='checkbox'> : <input type='checkbox'>] 
[task 2020-08-15T01:12:17.653Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.653Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.653Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.654Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.654Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.654Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.654Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.654Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.655Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.655Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.655Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.656Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.656Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.656Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.656Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.657Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.657Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Comparing print preview didn't succeed [<input type='radio'> : <input type='radio'>] 
[task 2020-08-15T01:12:17.657Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.659Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.659Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.659Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.662Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.662Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.662Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.663Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.663Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.663Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.663Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.664Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.664Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.664Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.665Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.669Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.669Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Comparing print preview didn't succeed [<select></select> : <select></select>] 
[task 2020-08-15T01:12:17.669Z] 01:12:17     INFO - Buffered messages logged at 01:12:17
[task 2020-08-15T01:12:17.670Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.670Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.670Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.670Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.670Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.670Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.671Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.671Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.671Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.671Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.671Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.671Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.671Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.672Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.672Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.672Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.672Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Comparing print preview didn't succeed [<select size='5'></select> : <select size='5'></select>] 
[task 2020-08-15T01:12:17.672Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.673Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.673Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.673Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.673Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.673Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.673Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.673Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.674Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.674Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.674Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.674Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.674Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.674Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.675Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.675Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.675Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Comparing print preview didn't succeed [<textarea></textarea> : <textarea></textarea>] 
[task 2020-08-15T01:12:17.680Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.680Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.680Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.680Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.681Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.681Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.681Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.681Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.681Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.681Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.681Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.682Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.682Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.682Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.682Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.682Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.682Z] 01:12:17     INFO - Buffered messages finished
[task 2020-08-15T01:12:17.683Z] 01:12:17     INFO - TEST-UNEXPECTED-FAIL | layout/base/tests/chrome/test_printpreview.xhtml | Comparing print preview didn't succeed [<input type='text'> : <input type='text' value='text'>] - got true, expected false
[task 2020-08-15T01:12:17.683Z] 01:12:17     INFO - SimpleTest.is@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:500:14
[task 2020-08-15T01:12:17.683Z] 01:12:17     INFO - compareFormElementPrint@chrome://mochitests/content/chrome/layout/base/tests/chrome/printpreview_helper.xhtml:241:5
[task 2020-08-15T01:12:17.683Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:17.683Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:17.683Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.683Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.683Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.683Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.684Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.684Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.684Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.684Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.684Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:17.694Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:17.694Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.694Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.694Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.694Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.695Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.695Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.695Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.695Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
[task 2020-08-15T01:12:17.695Z] 01:12:17     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-08-15T01:12:17.695Z] 01:12:17     INFO - TEST-UNEXPECTED-FAIL | layout/base/tests/chrome/test_printpreview.xhtml | Comparing print preview didn't succeed [<input type='password'> : <input type='password' value='password'>] - got true, expected false
[task 2020-08-15T01:12:17.695Z] 01:12:17     INFO - SimpleTest.is@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:500:14
[task 2020-08-15T01:12:17.695Z] 01:12:17     INFO - compareFormElementPrint@chrome://mochitests/content/chrome/layout/base/tests/chrome/printpreview_helper.xhtml:241:5
[task 2020-08-15T01:12:17.871Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: Caller should supply a printer name.: file /builds/worker/checkouts/gecko/widget/nsPrintSettingsService.cpp, line 995
[task 2020-08-15T01:12:17.876Z] 01:12:17     INFO - GECKO(2457) | [2457, Main Thread] WARNING: NS_ENSURE_TRUE(rootView) failed: file /builds/worker/checkouts/gecko/layout/base/nsPresContext.cpp, line 864
[task 2020-08-15T01:12:17.876Z] 01:12:17     INFO - onProgressChange | , , 0, 0, 0, 0
[task 2020-08-15T01:12:17.876Z] 01:12:17     INFO - onStateChange | , , 393217, 0
[task 2020-08-15T01:12:17.877Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.877Z] 01:12:17     INFO - onStateChange | , , 131088, 0
[task 2020-08-15T01:12:17.877Z] 01:12:17     INFO - onProgressChange | , , 100, 100, 100, 100
[task 2020-08-15T01:12:17.877Z] 01:12:17     INFO - onStateChange | , , 262160, 0
[task 2020-08-15T01:12:17.877Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called beforeprint listener! 
[task 2020-08-15T01:12:17.877Z] 01:12:17     INFO - TEST-PASS | layout/base/tests/chrome/test_printpreview.xhtml | Should have called afterprint listener! 
...
Flags: needinfo?(dholbert)
Regressions: 1659222
No longer regressions: 1659222

The test failure here seems to be due to a quirk of the testcase:
(1) the test renders print-preview into a vertically-short print-preview area (such that it triggers the new "vertical fit" stuff here, to some substantial extent)
(2) the test only snapshots a small portion of the print-preview area, at the top left corner.

The scaling-down (#1) means that the print previewed document is no longer near the top left corner (the area that gets snapshotted), so the rendering that we're trying to capture & compare isn't there. So != style comparisons for different print-preview documents end up failing (in that the canvases are equal).

I think emilio is correct that his test changes (to printpreview_helper.xhtml) in https://phabricator.services.mozilla.com/D87063 will address this, but there may also be a more targeted hackaround that I can make so that this isn't blocked on that.

Flags: needinfo?(dholbert)

This hange ensures that the upper-left corner of this test's print-preview
area continues to show the previewed sheet (rather than the uninteresting gray
print preview background color).

Without this test change, the next patch in this series would cause this test's
print-previewed-sheet to be scaled down vertically (and shifted over
horizontally); and the shift is sizeable enough to push the sheet "out of
frame" of the relatively-small area that this test snapshots when doing
screenshot comparisons. We obviously don't want that to happen; that would
nerf this test's screenshot-equality comparisons, and it would also cause this
test's screenshot-not-equal comparisons to start failing.

As noted in the included code-comment in the test: we can probably revert this
change once we've fixed this test to make it compare a larger area of the
print-preview rendering, in bug 1602410.

Attachment #9169940 - Attachment description: Bug 1658173: Scale down print-preview so that every sheet fits into the scrollport, in both dimensions (not just the inline axis). r?emilio → Bug 1658173 part 2: Scale down print-preview so that every sheet fits into the scrollport, in both dimensions (not just the inline axis). r?emilio

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

there may also be a more targeted hackaround that I can make so that this isn't blocked on that.

Here's a targeted hackaround that seems to work here (locally at least).

Try run:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5d2d35d17dbc69c0f108e2f8b3711b3c546c87fb

One more thing I need to sort out here before landing: that Try showed a webrender-only subtest failure for test_printpreview.xhtml's rendering of printpreview_images.html, with data URIs shown in the attached screenshot.

Sample failure log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=313226376&repo=try&lineNumber=106462

It's a real misrendering on the border between some elements, it looks like, and it's almost certainly an existing bug that happens to be exposed with the particular zoom factor that we use as a result of the two patches here.

It may be something I can work around for now with some fuzzy allowance in the test's comparison (I think the comparison API that we're using supports fuzzy mismatches...)

Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/710b3cc7180b
part 1: Increase the height of the print-preview viewport in automated test. r=emilio
https://hg.mozilla.org/integration/autoland/rev/ffbf9b386842
part 2: Scale down print-preview so that every sheet fits into the scrollport, in both dimensions (not just the inline axis). r=emilio
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: