Closed Bug 789507 Opened 13 years ago Closed 13 years ago

Printing doesn't work and the tab hangs if mozPrintCallback doesn't call done()

Categories

(Core :: Layout, defect)

x86
Windows 7
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla18
Tracking Status
firefox18 + fixed

People

(Reporter: spammaaja, Assigned: bdahl)

References

(Blocks 1 open bug)

Details

(Whiteboard: [qa?])

Attachments

(2 files, 2 obsolete files)

If mozPrintCallback is used, there will just be an infinite progress bar when printing. If you click cancel and attempt to print again, you get a "Printer Error - Not available" messagebox. The print preview window cannot be closed with the close button. The tab also hangs: the url bar, back button, refresh button etc. stop working. Error console says: Error: TypeError: ctx.fillRect is not a function
Attachment #659284 - Attachment mime type: text/plain → text/html
Blocks: 745025
OS: All → Windows 7
Hardware: All → x86
That's a bad example, but yes we need to handle the case when the mozPrintCallback never calls done() to signal that it is done.
Attachment #659284 - Attachment description: mozPrintCallback example https://gist.github.com/2230187 → mozPrintCallback example from https://gist.github.com/2230187
Summary: Printing doesn't work and the tab hangs if mozPrintCallback is used → Printing doesn't work and the tab hangs if mozPrintCallback doesn't call done()
Need to get this fixed before next merge.
Attached patch mozPrintCallback watch dog v1 (obsolete) — Splinter Review
Attachment #665609 - Flags: review?(bugs)
Attached patch mozPrintCallback watch dog v2 (obsolete) — Splinter Review
Addresses comments from irc: - comment on what calls notify - reset watchdog counter only from mozPrintCallback - cleanup on destroy instead of failure
Attachment #665609 - Attachment is obsolete: true
Attachment #666036 - Flags: review?(bugs)
Comment on attachment 666036 [details] [diff] [review] mozPrintCallback watch dog v2 > nsPagePrintTimer::Notify(nsITimer *timer) > { >+ // When finished there still may be pending notifications just ignore them. Something like When finished there may be still pending notifications, which we can just ignore. this is not pretty, but we can improve the situation in FF19. And hopefully there will be some more ideas in whatwg mailing list.
Attachment #666036 - Flags: review?(bugs) → review+
Comment update. Carrying forward r+
Attachment #666036 - Attachment is obsolete: true
Attachment #667057 - Flags: review+
Keywords: checkin-needed
Assignee: nobody → bdahl
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
(In reply to Ryan VanderMeulen from comment #9) > https://hg.mozilla.org/integration/mozilla-inbound/rev/fe034183d766 > > Should this have a test? It ideally would, but there currently isn't an easy way to test the print engine.
There are ways to test print preview, and indeed this should have a test.
While using the attachment I could reproduce the issue on 2012-09-07 Nightly Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 Build ID: 20120907030554 Tested on Firefox 18.0 beta 2 whit the same attachment Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0 Build ID: 20121128060531 a message of "An unknown error occurred while printing" while the printing bar was in progress. I clicked "Ok" and started a new print job. While printing bar was in progress, I clicked on "Cancel". A "Not available" message appears and after a few seconds, the other message of "An unknown error occurred while printing" appeared. Same behavior in Latest Nightly Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20121204 Firefox/20.0 Build ID: 20121204030754
Whiteboard: [qa?]
Depends on: 844479
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: