Bug 1516307 - Make nsIDOMWindowUtils.getResolution return the result value. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D15318

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Hiroyuki Ikezoe 2018-12-30 01:15:27 +00:00
Родитель 7e3ca361db
Коммит f36f418011
6 изменённых файлов: 15 добавлений и 17 удалений

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

@ -178,9 +178,7 @@ var Utils = { // jshint ignore:line
},
getContentResolution: function _getContentResolution(aAccessible) {
let res = { value: 1 };
aAccessible.document.window.windowUtils.getResolution(res);
return res.value;
return aAccessible.document.window.windowUtils.getResolution();
},
getBounds: function getBounds(aAccessible) {

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

@ -220,7 +220,7 @@ interface nsIDOMWindowUtils : nsISupports {
*/
void setResolutionAndScaleTo(in float aResolution);
void getResolution(out float aResolution);
float getResolution();
/**
* Set a resolution on the presShell which is the "restored" from history.

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

@ -4,9 +4,9 @@
// Utilities for synthesizing of native events.
function getResolution() {
let resolution = { value: -1 }; // bogus value in case DWU fails us
SpecialPowers.getDOMWindowUtils(window).getResolution(resolution);
return resolution.value;
let resolution = -1; // bogus value in case DWU fails us
resolution = SpecialPowers.getDOMWindowUtils(window).getResolution();
return resolution;
}
function getPlatform() {

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

@ -88,12 +88,12 @@ class GeckoViewContentChild extends GeckoViewChildModule {
let [formdata, scrolldata] = this.Utils.mapFrameTree(content, FormData.collect, ssu.collectScrollPosition.bind(ssu));
// Save the current document resolution.
let zoom = { value: 1 };
let zoom = 1;
let domWindowUtils = content.windowUtils;
domWindowUtils.getResolution(zoom);
zoom = domWindowUtils.getResolution();
scrolldata = scrolldata || {};
scrolldata.zoom = {};
scrolldata.zoom.resolution = zoom.value;
scrolldata.zoom.resolution = zoom;
// Save some data that'll help in adjusting the zoom level
// when restoring in a different screen orientation.

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

@ -936,11 +936,11 @@ SessionStore.prototype = {
scrolldata = scrolldata || {};
// Save the current document resolution.
let zoom = { value: 1 };
content.windowUtils.getResolution(zoom);
let zoom = 1;
zoom = content.windowUtils.getResolution();
scrolldata.zoom = {};
scrolldata.zoom.resolution = zoom.value;
log("onTabScroll() zoom level: " + zoom.value);
scrolldata.zoom.resolution = zoom;
log("onTabScroll() zoom level: " + zoom);
// Save some data that'll help in adjusting the zoom level
// when restoring in a different screen orientation.

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

@ -72,8 +72,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1498892
let {x, y, zoom} = data;
let utils = getFrame(browser, data).windowUtils;
let actualX = {}, actualY = {}, actualZoom = {};
utils.getResolution(actualZoom);
let actualX = {}, actualY = {};
let actualZoom = utils.getResolution();
utils.getScrollXY(false, actualX, actualY);
if (data.hasOwnProperty("x")) {
@ -83,7 +83,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1498892
is(actualY.value, y, "scrollY set correctly");
}
if (data.hasOwnProperty("zoom")) {
ok(fuzzyEquals(actualZoom.value, zoom), "zoom set correctly");
ok(fuzzyEquals(actualZoom, zoom), "zoom set correctly");
}
}