Bug 1089815 - View source print preview browser does not have a message manager. r=Mossop.

<xul:browser>'s do not get messageManager's constructed for them unless they
have their type attribute set to "content", "content-targetable", or
"content-primary". This patch updates the view source print preview browser
with that type attribute, and also updates the PrintUtils documentation to
mention this requirement.

--HG--
extra : amend_source : 12638e8fd0c0da9b3036d7892d02a360b7513ec5
This commit is contained in:
Mike Conley 2014-11-04 12:10:15 -05:00
parent 081dd6f1d7
commit 7375e28be3
2 changed files with 14 additions and 3 deletions

View File

@ -19,6 +19,10 @@
* the object that listens and responds to the messages that PrintUtils
* sends.
*
* This also means that <xul:browser>'s that hope to use PrintUtils must have
* their type attribute set to either "content", "content-targetable", or
* "content-primary".
*
* PrintUtils sends messages at different points in its implementation, but
* their documentation is consolidated here for ease-of-access.
*
@ -122,7 +126,9 @@ var PrintUtils = {
* The remote <xul:browser> that contains aWindow. This argument is
* not necessary if aWindow came from a non-remote browser, but is
* strictly required otherwise. This function will throw if aWindow
* comes from a remote browser and aBrowser is not provided.
* comes from a remote browser and aBrowser is not provided. This
* browser must have its type attribute set to "content",
* "content-targetable", or "content-primary".
*/
print: function (aWindow, aBrowser)
{
@ -176,11 +182,14 @@ var PrintUtils = {
* An object that defines the following functions:
*
* getPrintPreviewBrowser:
* Returns the <xul:browser> to display the print preview in.
* Returns the <xul:browser> to display the print preview in. This
* <xul:browser> must have its type attribute set to "content",
* "content-targetable", or "content-primary".
*
* getSourceBrowser:
* Returns the <xul:browser> that contains the document being
* printed.
* printed. This <xul:browser> must have its type attribute set to
* "content", "content-targetable", or "content-primary".
*
* getNavToolbox:
* Returns the primary toolbox for this window.

View File

@ -335,9 +335,11 @@ var PrintPreviewListener = {
browser = document.createElement("browser");
browser.setAttribute("id", "ppBrowser");
browser.setAttribute("flex", "1");
browser.setAttribute("type", "content");
document.getElementById("appcontent").
insertBefore(browser, document.getElementById("FindToolbar"));
}
return browser;
},
getSourceBrowser: function () {