Bug 1620950 - Port Bug 1602561. Make PrintUtils.printWindow() act on a BrowsingContext. r=Paenglab

Port of https://hg.mozilla.org/mozilla-central/rev/c78f989b17befffd3009ce9fea4103a759bbbd71
This commit is contained in:
Magnus Melin 2020-03-10 22:53:11 +02:00
Родитель 7b94824872
Коммит 87e443fdb0
3 изменённых файлов: 8 добавлений и 20 удалений

Просмотреть файл

@ -597,7 +597,7 @@ var contentTabBaseType = {
break;
case "cmd_print":
let browser = this.getBrowser(aTab);
PrintUtils.printWindow(browser.outerWindowID, browser);
PrintUtils.printWindow(browser.browsingContext);
break;
// XXX print preview not currently supported - bug 497994 to implement.
// case "cmd_printpreview":
@ -1583,7 +1583,7 @@ var specialTabs = {
break;
case "cmd_print":
let browser = this.getBrowser(aTab);
PrintUtils.printWindow(browser.outerWindowID, browser);
PrintUtils.printWindow(browser.browsingContext);
break;
// XXX print preview not currently supported - bug 497994 to implement.
// case "cmd_printpreview":

Просмотреть файл

@ -2078,10 +2078,8 @@ var nsPrintCommand = {
doCommandParams(aCommand, aParams, aRefCon) {},
doCommand(aCommand) {
try {
let browser = GetCurrentEditorElement();
PrintUtils.printWindow(browser.outerWindowID, browser);
} catch (e) {}
let browser = GetCurrentEditorElement();
PrintUtils.printWindow(browser.browsingContext);
},
};
@ -2095,9 +2093,7 @@ var nsPrintPreviewCommand = {
doCommandParams(aCommand, aParams, aRefCon) {},
doCommand(aCommand) {
try {
PrintUtils.printPreview(PrintPreviewListener);
} catch (e) {}
PrintUtils.printPreview(PrintPreviewListener);
},
};

Просмотреть файл

@ -2409,20 +2409,12 @@ function DoCommandClose() {
}
function DoCommandPrint() {
try {
let editor = GetCurrentEditorElement();
PrintUtils.printWindow(editor.outerWindowID, editor);
} catch (ex) {
dump("#PRINT ERROR: " + ex + "\n");
}
let browser = GetCurrentEditorElement();
PrintUtils.printWindow(browser.browsingContext);
}
function DoCommandPrintPreview() {
try {
PrintUtils.printPreview(PrintPreviewListener);
} catch (ex) {
Cu.reportError(ex);
}
PrintUtils.printPreview(PrintPreviewListener);
}
/**