Closed Bug 1663140 Opened 4 years ago Closed 4 years ago

Print preview displays blank pages for pdf documents

Categories

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

defect

Tracking

()

VERIFIED FIXED
82 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox80 --- unaffected
firefox81 --- verified
firefox82 --- verified

People

(Reporter: emilghitta, Assigned: emilio)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, regressionwindow-wanted, Whiteboard: [print2020_v81] [old-ui-])

Attachments

(2 files)

Attached image pdfJS.gif

Affected versions

  • 82.0a1 (BuildId:20200903151816)
  • 81.0b6 (BuildId:20200903205131)

Affected platforms

  • Windows 10 64bit
  • Ubuntu 18.04 64bit
  • macOS 10.14

Steps to reproduce

  1. Launch Firefox
  2. Access the following link
  3. Click the print button.

Expected result

  • The print preview successfully displays the pdf file.

Actual result

  • The print preview displays a blank pdf and it cannot be printed.

Regression Window

  • This seems to be a regression but I can’t reproduce this issue using mozregression (odd..) I’ll try to search for a manual regression as soon as time permits.

Additional Information

  • For further information regarding this issue please observe the attached screencast.

Emil, you probably put a wrong link in comment 0.

Flags: needinfo?(emil.ghitta)

Whoops..the correct one is http://www.dbsparks.com/research/html/SNRN02.pdf

On a second glance...I can't seem to reproduce this using latest Nightly 82.0a1 BuildId: 20200903151816 (only latest beta)...so this may have been already fixed somewhere else.

But the interesting part is that I've reproduced it while testing the opt build for https://bugzilla.mozilla.org/show_bug.cgi?id=1663053#c10 (That's Firefox 82.0a1 BuildId:20200904094341)

Flags: needinfo?(emil.ghitta)

(In reply to Emil Ghitta, QA [:emilghitta] from comment #2)

But the interesting part is that I've reproduced it while testing the opt build for https://bugzilla.mozilla.org/show_bug.cgi?id=1663053#c10 (That's Firefox 82.0a1 BuildId:20200904094341)

That's concerning.

Just updated Nightly to 82.0a1 (BuildId:20200904094341) and this issue is reproducible.

I think that this may be considered as a blocker for this feature ?

Flags: needinfo?(jwatt)

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=00a41c5183d7b3fedd9a632cccff8d0d3b970f60&tochange=ff9fbfbe506c186bb915ebfbdcd6e7cc130b3384

Suspect : 52d0f9a901a939bbf66f90dc5004527159a0937a Emilio Cobos Álvarez — Bug 1662975 - Don't return from window.print() until the print dialog is closed. r=jwatt

Has Regression Range: --- → yes
Regressed by: 1662975

Error in Browser console when click print icon:

Error while calling actor 'frameTarget's method 'attach' An attempt was made to use an object that is not, or is no longer, usable Actor.js:95:13


sendPacket@resource://devtools/server/connectors/js-window-actor/DevToolsFrameChild.jsm:316:10
send@resource://devtools/shared/transport/js-window-actor-transport.js:51:25
send@resource://devtools/server/devtools-server-connection.js:99:20
sendReturn@resource://devtools/shared/protocol/Actor.js:192:16
webViewerPrint@resource://pdf.js/web/viewer.js:2184:10
dispatch/<@resource://pdf.js/web/viewer.js:3427:16
dispatch@resource://pdf.js/web/viewer.js:3414:29
_bindListeners/<@resource://pdf.js/web/viewer.js:11937:25
EventListener.handleEvent*_bindListeners@resource://pdf.js/web/viewer.js:11935:15
Toolbar@resource://pdf.js/web/viewer.js:11887:10
_initializeViewerComponents@resource://pdf.js/web/viewer.js:620:20
initialize@resource://pdf.js/web/viewer.js:443:16
async*run@resource://pdf.js/web/viewer.js:660:10
webViewerLoad@resource://pdf.js/web/viewer.js:260:36
EventListener.handleEvent*@resource://pdf.js/web/viewer.js:266:12
__webpack_require__@resource://pdf.js/web/viewer.js:42:30
@resource://pdf.js/web/viewer.js:106:18
@resource://pdf.js/web/viewer.js:109:10
Actor.js:100:15


NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIObserverService.removeObserver] browsing-context.js:1026


Error while calling actor 'frameTarget's method 'attach' An attempt was made to use an object that is not, or is no longer, usable Actor.js:95:13


sendPacket@resource://devtools/server/connectors/js-window-actor/DevToolsFrameChild.jsm:316:10
send@resource://devtools/shared/transport/js-window-actor-transport.js:51:25
send@resource://devtools/server/devtools-server-connection.js:99:20
sendReturn@resource://devtools/shared/protocol/Actor.js:192:16
webViewerPrint@resource://pdf.js/web/viewer.js:2184:10
dispatch/<@resource://pdf.js/web/viewer.js:3427:16
dispatch@resource://pdf.js/web/viewer.js:3414:29
_bindListeners/<@resource://pdf.js/web/viewer.js:11937:25
EventListener.handleEvent*_bindListeners@resource://pdf.js/web/viewer.js:11935:15
Toolbar@resource://pdf.js/web/viewer.js:11887:10
_initializeViewerComponents@resource://pdf.js/web/viewer.js:620:20
initialize@resource://pdf.js/web/viewer.js:443:16
async*run@resource://pdf.js/web/viewer.js:660:10
webViewerLoad@resource://pdf.js/web/viewer.js:260:36
EventListener.handleEvent*@resource://pdf.js/web/viewer.js:266:12
__webpack_require__@resource://pdf.js/web/viewer.js:42:30
@resource://pdf.js/web/viewer.js:106:18
@resource://pdf.js/web/viewer.js:109:10
Actor.js:100:15


TypeError: can't access property "watch", this._progressListener is null
    _watchDocshells resource://devtools/server/actors/targets/browsing-context.js:693
    _attach resource://devtools/server/actors/targets/browsing-context.js:682
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
    webViewerPrint resource://pdf.js/web/viewer.js:2184
    dispatch resource://pdf.js/web/viewer.js:3427
    dispatch resource://pdf.js/web/viewer.js:3414
    _bindListeners resource://pdf.js/web/viewer.js:11937
    _bindListeners resource://pdf.js/web/viewer.js:11935
    Toolbar resource://pdf.js/web/viewer.js:11887
    _initializeViewerComponents resource://pdf.js/web/viewer.js:620
    initialize resource://pdf.js/web/viewer.js:443
    run resource://pdf.js/web/viewer.js:660
    webViewerLoad resource://pdf.js/web/viewer.js:260
    EventListener.handleEvent* resource://pdf.js/web/viewer.js:266
    __webpack_require__ resource://pdf.js/web/viewer.js:42
    <anonymous> resource://pdf.js/web/viewer.js:106
    <anonymous> resource://pdf.js/web/viewer.js:109
ThreadSafeDevToolsUtils.js:82:13


InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable 2 DevToolsFrameChild.jsm:316


printing.preview_opened_tm - Cannot record the scalar in the current process.


I think I know what might be going on.

Assignee: nobody → emilio
Flags: needinfo?(emilio)

Not really a fan of this, but I can't think of a better alternative
really... Ideas welcome :)

The main issue is that in bug 1662975 we made window.print() not return
until the user has closed the print / print preview dialog (as it is
needed for some use cases). This matches other browsers, too.

We use an nsAutoSyncOperation here, in order not to violate the
run-to-completion invariants, which turns off micro-tasks, timers,
etc... However we'd still want promises inside mozPrintCallback to
resolve and such, which is a bit contradictory. It is really awkward to
have this behavior change based on whether we have a print callback...

Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/45df7207f4e1
Don't block on window.print() if there are print callbacks. r=smaug
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8c45d44b05da
Don't block on window.print() if there are print callbacks. r=smaug
Regressions: 1663330
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch

Comment on attachment 9174017 [details]
Bug 1663140 - Don't block on window.print() if there are print callbacks. r=jwatt,smaug

Beta/Release Uplift Approval Request

  • User impact if declined: comment 0
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 0
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Behind pref, only affects the new print ui
  • String changes made/needed: none
Attachment #9174017 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]
Component: Printing → Printing: Setup
Flags: needinfo?(jwatt)
Priority: -- → P1
Product: Toolkit → Core

Comment on attachment 9174017 [details]
Bug 1663140 - Don't block on window.print() if there are print callbacks. r=jwatt,smaug

Approved for 81.0b8.

Attachment #9174017 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Hello,

Confirming this as verified fixed on 82.0a1 (2020-09-20) and 81.0 - pref'd on. Confirmed using Windows 10x64, macOS 10.15 and Ubuntu 20.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: