Closed Bug 1142997 Opened 5 years ago Closed 5 years ago

Cannot Print from Composer and other <editor> elements

Categories

(SeaMonkey :: Composer, defect)

SeaMonkey 2.33 Branch
x86
All
defect
Not set
normal

Tracking

(firefox37 fixed, firefox38 fixed, firefox39 fixed, seamonkey2.34 fixed, seamonkey2.35 fixed, seamonkey2.36 fixed)

VERIFIED FIXED
seamonkey2.36
Tracking Status
firefox37 --- fixed
firefox38 --- fixed
firefox39 --- fixed
seamonkey2.34 --- fixed
seamonkey2.35 --- fixed
seamonkey2.36 --- fixed

People

(Reporter: therubex, Assigned: philip.chee)

References

Details

Attachments

(1 file, 1 obsolete file)

Open Composer

File Print
or
File Print Preview

Nothing happens.
Kind of see a "flash" with Print Preview, but that's the extent of it.
 
 
Error Console:

> Error: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE)
> [nsIWebBrowserPrint.printPreview]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"
> location: "JS frame :: chrome://global/content/browser-content.js :: enterPrintPreview
> :: line 441"  data: no]
> Source File: chrome://global/content/browser-content.js
> Line: 445
 
 
This is a regression from SeaMonkey 2.32.1.
 
 
Perhaps related to or some offshoot of Bug 1088070 - Instantiate print settings from the content process instead of the parent
Duplicate of this bug: 1143702
Flags: needinfo?(mconley)
Waiting for information from RattyAway about what information is getting passed to printPreview.
Flags: needinfo?(mconley)
I sprinkled dump() all over. Looks like editor.xml needs two properties copied over from browser.xml:

contentWindowAsCPOW
messageManager

After adding these two properties to editor.xml, print and print preview work with no problems.

Optionally in printUtils.js -> enterPrintPreview
we could also do:

-      contentWindow: this._sourceBrowser.contentWindowAsCPOW,
+      contentWindow: this._sourceBrowser.contentWindowAsCPOW ||
+                     this._sourceBrowser.contentWindow,
Assignee: nobody → philip.chee
Status: NEW → ASSIGNED
Attachment #8580222 - Flags: review?
Summary: Cannot Print from Composer → Cannot Print from Composer and other <editor> elements
(In comment #3)
> 
> I sprinkled dump() all over. Looks like editor.xml needs two properties
> copied over from browser.xml:
> 
> contentWindowAsCPOW
> messageManager
> 
> After adding these two properties to editor.xml, print and print preview
> work with no problems.
> 
> Optionally in printUtils.js -> enterPrintPreview
> we could also do:
> 
> -      contentWindow: this._sourceBrowser.contentWindowAsCPOW,
> +      contentWindow: this._sourceBrowser.contentWindowAsCPOW ||
> +                     this._sourceBrowser.contentWindow,

mconley suggests that fixing printUtils.js is a good idea.
Attachment #8580222 - Attachment is obsolete: true
Attachment #8580222 - Flags: review?
Attachment #8580228 - Flags: review?(dtownsend)
Comment on attachment 8580228 [details] [diff] [review]
Patch v1.1 Proposed fix include fix to printUtils.js

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

::: toolkit/components/printing/content/printUtils.js
@@ +411,5 @@
>      let ppBrowser = this._listener.getPrintPreviewBrowser();
>      let mm = ppBrowser.messageManager;
>      mm.sendAsyncMessage("Printing:Preview:Enter", null, {
> +      contentWindow: this._sourceBrowser.contentWindowAsCPOW ||
> +                     this._sourceBrowser.contentWindow,

So is this change still necessary?
(In reply to Dave Townsend [:mossop] from comment #5)

>> +      contentWindow: this._sourceBrowser.contentWindowAsCPOW ||
>> +                     this._sourceBrowser.contentWindow,
> 
> So is this change still necessary?
This bit is not necessary currently, but over mconley asked me to keep this bit in. Should I remove this?
Comment on attachment 8580222 [details] [diff] [review]
Patch v1.0 without changes in printUtils.js

Original patch without printUtils.js
Attachment #8580222 - Attachment description: Patch v1.0 Proposed fix → Patch v1.0 without changes in printUtils.js
Attachment #8580222 - Attachment is obsolete: false
Attachment #8580222 - Flags: review?(dtownsend)
Duplicate of this bug: 1145649
Comment on attachment 8580228 [details] [diff] [review]
Patch v1.1 Proposed fix include fix to printUtils.js

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

Sorry, I see what is going on now, let's take this patch. I'm going to try to drop the need for contentWindowAsCPOW entirely from this in bug 1146454.

::: toolkit/content/widgets/editor.xml
@@ +144,5 @@
>                  readonly="true"
>                  onget="return this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow);"/>
> +      <property name="contentWindowAsCPOW"
> +                readonly="true"
> +                onget="return this.contentWindow;"/>

Though I am going to ask if this part is still necessary now we make printUtils work with contentWindow? If you want to leave it in to cover other cases that might be in the codebase then that's fine.
Attachment #8580228 - Flags: review?(dtownsend) → review+
Attachment #8580222 - Attachment is obsolete: true
Attachment #8580222 - Flags: review?(dtownsend)
https://hg.mozilla.org/mozilla-central/rev/c4950a780504
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.36
Duplicate of this bug: 1147284
OS = "All" due to DUPs
OS: Windows XP → All
Duplicate of this bug: 1146055
No idea what this means:

From: nobody@cruncher.build.mozilla.org

Improvement: Mozilla-Inbound-Non-PGO - TP5 Scroll - WINNT 6.1 (ix) - 2.73% decrease
-----------------------------------------------------------------------------------
    Previous: avg 4.823 stddev 0.055 of 12 runs up to revision 5850aa2851fe
    New     : avg 4.692 stddev 0.030 of 12 runs since revision c4950a780504
    Change  : -0.131 (2.73% / z=2.408)
    Graph   : http://mzl.la/1NbHCdc

Changeset range: http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=5850aa2851fe&tochange=c4950a780504

Changesets:
  * http://hg.mozilla.org/integration/mozilla-inbound/rev/c4950a780504
    : Philip Chee <philip.chee@gmail.com> - Bug 1142997 - Cannot Print from Composer and other <editor> elements r=mossop
    : http://bugzilla.mozilla.org/show_bug.cgi?id=1142997

Bugs:
  * http://bugzilla.mozilla.org/show_bug.cgi?id=1142997 - Cannot Print from Composer and other <editor> elements
Comment on attachment 8580228 [details] [diff] [review]
Patch v1.1 Proposed fix include fix to printUtils.js

Approval Request Comment
[Feature/regressing bug #]: Bug 1088070
[User impact if declined]: Cannot print from pages using <editor> elements
Also credited with a 2.73% improvement in TP5 Scroll [1].
[Describe test coverage new/current, TreeHerder]: Baked on mozilla-central since 2015-03-24
[Risks and why]: low risk - regression fix. 
[String/UUID change made/needed]: none


[1] From: nobody@cruncher.build.mozilla.org

Improvement: Mozilla-Inbound-Non-PGO - TP5 Scroll - WINNT 6.1 (ix) - 2.73% decrease
-----------------------------------------------------------------------------------
    Previous: avg 4.823 stddev 0.055 of 12 runs up to revision 5850aa2851fe
    New     : avg 4.692 stddev 0.030 of 12 runs since revision c4950a780504
    Change  : -0.131 (2.73% / z=2.408)
    Graph   : http://mzl.la/1NbHCdc

Changeset range: http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=5850aa2851fe&tochange=c4950a780504

Changesets:
  * http://hg.mozilla.org/integration/mozilla-inbound/rev/c4950a780504
    : Philip Chee <philip.chee@gmail.com> - Bug 1142997 - Cannot Print from Composer and other <editor> elements r=mossop
    : http://bugzilla.mozilla.org/show_bug.cgi?id=1142997

Bugs:
  * http://bugzilla.mozilla.org/show_bug.cgi?id=1142997 - Cannot Print from Composer and other <editor> elements
Attachment #8580228 - Flags: approval-mozilla-beta?
Attachment #8580228 - Flags: approval-mozilla-aurora?
Comment on attachment 8580228 [details] [diff] [review]
Patch v1.1 Proposed fix include fix to printUtils.js

thanks for the perf feedback!
it should be in beta 2
Attachment #8580228 - Flags: approval-mozilla-beta?
Attachment #8580228 - Flags: approval-mozilla-beta+
Attachment #8580228 - Flags: approval-mozilla-aurora?
Attachment #8580228 - Flags: approval-mozilla-aurora+
Duplicate of this bug: 1170054
No longer  reproducible with EN-US SeaMonkey 2.38a1 build by Ruediger Lahl, Gecko/20100101, Build 20150531140409 (Default Theme) on German WIN7 64bit: Menu 'Print' now brings up Print Dialog as expected in new Mail and new HTML Composer document

So VERIFIED (for WIN)
Status: RESOLVED → VERIFIED
 2015-08-01 Nightly Build from <http://ftp.mozilla.org/pub/mozilla.org/seamonkey/nightly/latest-comm-central-trunk/> build. Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39a1 ID:20150801003001 CSet: 85f81472a34c

Composer print/preview locks-up at the progress-pane stage-
Error Console produces this eror:-

Timestamp: 03/08/15 14:45:01
Error: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIWebBrowserPrint.printPreview]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: chrome://global/content/browser-content.js :: enterPrintPreview :: line 466"  data: no]
Source File: chrome://global/content/browser-content.js
Line: 470

Also, I just tried the print/print-preview from the "new-message" compose / Editor pane, and got the identical error again. Works fine for received messages, so is similar to this bug if I'm wrong.

Similar error for New Message (Compose/Editor)
Timestamp: 03/08/15 15:07:50
Error: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIWebBrowserPrint.printPreview]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: chrome://global/content/browser-content.js :: enterPrintPreview :: line 466"  data: no]
Source File: chrome://global/content/browser-content.js
Line: 470 

HTH.
I do not know if Patch v1.1 is responsible because a backout was not possible with the current source of Trunk. And I haven't searched for a regression window.
Blocks: 1190344
(In reply to Hartmut Figge from comment #22)
> I do not know if Patch v1.1 is responsible because a backout was not
> possible with the current source of Trunk. And I haven't searched for a
> regression window.

I don't think so but I have raised a bug against Toolkit -> Printing, as something has regressed in that code.
See Also: → 1190348
The fix for this one has been verified. So I opened "Bug 1190348 - File → Print will not launch Printing dialog form Composer applications" for now.
You need to log in before you can comment on or make changes to this bug.