forked from mirrors/gecko-dev
Bug 1783086 - [marionette] Rename printBackground to background for WebDriver compatibility. r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D171693
This commit is contained in:
parent
5ac03ecad1
commit
8f8a400ed5
3 changed files with 7 additions and 10 deletions
|
|
@ -3010,6 +3010,9 @@ GeckoDriver.prototype.teardownReftest = function() {
|
||||||
/**
|
/**
|
||||||
* Print page as PDF.
|
* Print page as PDF.
|
||||||
*
|
*
|
||||||
|
* @param {boolean=} background
|
||||||
|
* Whether or not to print background colors and images.
|
||||||
|
* Defaults to false, which prints without background graphics.
|
||||||
* @param {boolean=} landscape
|
* @param {boolean=} landscape
|
||||||
* Paper orientation. Defaults to false.
|
* Paper orientation. Defaults to false.
|
||||||
* @param {number=} margin.bottom
|
* @param {number=} margin.bottom
|
||||||
|
|
@ -3027,14 +3030,12 @@ GeckoDriver.prototype.teardownReftest = function() {
|
||||||
* Paper height in cm. Defaults to US letter height (27.94cm / 11 inches)
|
* Paper height in cm. Defaults to US letter height (27.94cm / 11 inches)
|
||||||
* @param {number=} page.width
|
* @param {number=} page.width
|
||||||
* Paper width in cm. Defaults to US letter width (21.59cm / 8.5 inches)
|
* Paper width in cm. Defaults to US letter width (21.59cm / 8.5 inches)
|
||||||
|
* @param {number=} scale
|
||||||
|
* Scale of the webpage rendering. Defaults to 1.0.
|
||||||
* @param {boolean=} shrinkToFit
|
* @param {boolean=} shrinkToFit
|
||||||
* Whether or not to override page size as defined by CSS.
|
* Whether or not to override page size as defined by CSS.
|
||||||
* Defaults to true, in which case the content will be scaled
|
* Defaults to true, in which case the content will be scaled
|
||||||
* to fit the paper size.
|
* to fit the paper size.
|
||||||
* @param {boolean=} printBackground
|
|
||||||
* Print background graphics. Defaults to false.
|
|
||||||
* @param {number=} scale
|
|
||||||
* Scale of the webpage rendering. Defaults to 1.
|
|
||||||
*
|
*
|
||||||
* @return {string}
|
* @return {string}
|
||||||
* Base64 encoded PDF representing printed document
|
* Base64 encoded PDF representing printed document
|
||||||
|
|
@ -3076,7 +3077,7 @@ GeckoDriver.prototype.print = async function(cmd) {
|
||||||
)(settings.scale);
|
)(settings.scale);
|
||||||
lazy.assert.boolean(settings.shrinkToFit);
|
lazy.assert.boolean(settings.shrinkToFit);
|
||||||
lazy.assert.boolean(settings.landscape);
|
lazy.assert.boolean(settings.landscape);
|
||||||
lazy.assert.boolean(settings.printBackground);
|
lazy.assert.boolean(settings.background);
|
||||||
lazy.assert.array(settings.pageRanges);
|
lazy.assert.array(settings.pageRanges);
|
||||||
|
|
||||||
const browsingContext = this.curBrowser.tab.linkedBrowser.browsingContext;
|
const browsingContext = this.curBrowser.tab.linkedBrowser.browsingContext;
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,6 @@ print.addDefaultSettings = function(settings) {
|
||||||
orientation = "portrait",
|
orientation = "portrait",
|
||||||
page = {},
|
page = {},
|
||||||
pageRanges = [],
|
pageRanges = [],
|
||||||
// TODO: Bug 1783086. Remove when marionette supports background argument.
|
|
||||||
printBackground = false,
|
|
||||||
scale = 1.0,
|
scale = 1.0,
|
||||||
shrinkToFit = true,
|
shrinkToFit = true,
|
||||||
} = settings;
|
} = settings;
|
||||||
|
|
@ -83,8 +81,6 @@ print.addDefaultSettings = function(settings) {
|
||||||
orientation,
|
orientation,
|
||||||
page,
|
page,
|
||||||
pageRanges,
|
pageRanges,
|
||||||
// TODO: Bug 1783086. Remove when marionette supports background argument.
|
|
||||||
printBackground,
|
|
||||||
scale,
|
scale,
|
||||||
shrinkToFit,
|
shrinkToFit,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -657,7 +657,7 @@ class MarionettePrintProtocolPart(PrintProtocolPart):
|
||||||
"bottom": margin,
|
"bottom": margin,
|
||||||
},
|
},
|
||||||
"shrinkToFit": False,
|
"shrinkToFit": False,
|
||||||
"printBackground": True,
|
"background": True,
|
||||||
}
|
}
|
||||||
return self.marionette._send_message("WebDriver:Print", body, key="value")
|
return self.marionette._send_message("WebDriver:Print", body, key="value")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue