From c43cc6396c9d7eada187ead1dd2fde5d43ba8dee Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Mon, 15 Oct 2018 23:53:43 +0000 Subject: [PATCH] Bug 1431601 - Move getViewportInfo function into viewport_helpers.js. r=botond Depends on D8317 Differential Revision: https://phabricator.services.mozilla.com/D8318 --HG-- extra : moz-landing-system : lando --- dom/base/test/test_meta_viewport0.html | 18 ------------------ dom/base/test/test_meta_viewport1.html | 18 ------------------ dom/base/test/test_meta_viewport2.html | 18 ------------------ dom/base/test/test_meta_viewport3.html | 18 ------------------ dom/base/test/test_meta_viewport4.html | 18 ------------------ dom/base/test/test_meta_viewport5.html | 18 ------------------ dom/base/test/test_meta_viewport6.html | 18 ------------------ dom/base/test/test_meta_viewport7.html | 18 ------------------ dom/base/test/viewport_helpers.js | 18 ++++++++++++++++++ 9 files changed, 18 insertions(+), 144 deletions(-) diff --git a/dom/base/test/test_meta_viewport0.html b/dom/base/test/test_meta_viewport0.html index b30e9e4582dc..29bdf4467a2a 100644 --- a/dom/base/test/test_meta_viewport0.html +++ b/dom/base/test/test_meta_viewport0.html @@ -51,24 +51,6 @@ }); }); - function getViewportInfo(aDisplayWidth, aDisplayHeight) { - let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {}, - width = {}, height = {}, autoSize = {}; - - let cwu = SpecialPowers.getDOMWindowUtils(window); - cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom, - minZoom, maxZoom, width, height, autoSize); - return { - defaultZoom: defaultZoom.value, - minZoom: minZoom.value, - maxZoom: maxZoom.value, - width: width.value, - height: height.value, - autoSize: autoSize.value, - allowZoom: allowZoom.value - }; - } - function nextTest() { if (tests.length) (tests.shift())(); diff --git a/dom/base/test/test_meta_viewport1.html b/dom/base/test/test_meta_viewport1.html index 74c56093ef53..350e9a1bc563 100644 --- a/dom/base/test/test_meta_viewport1.html +++ b/dom/base/test/test_meta_viewport1.html @@ -47,24 +47,6 @@ }); }); - function getViewportInfo(aDisplayWidth, aDisplayHeight) { - let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {}, - width = {}, height = {}, autoSize = {}; - - let cwu = SpecialPowers.getDOMWindowUtils(window); - cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom, - minZoom, maxZoom, width, height, autoSize); - return { - defaultZoom: defaultZoom.value, - minZoom: minZoom.value, - maxZoom: maxZoom.value, - width: width.value, - height: height.value, - autoSize: autoSize.value, - allowZoom: allowZoom.value - }; - } - function nextTest() { if (tests.length) (tests.shift())(); diff --git a/dom/base/test/test_meta_viewport2.html b/dom/base/test/test_meta_viewport2.html index c26e548f5b78..aedc36727e5c 100644 --- a/dom/base/test/test_meta_viewport2.html +++ b/dom/base/test/test_meta_viewport2.html @@ -47,24 +47,6 @@ }); }); - function getViewportInfo(aDisplayWidth, aDisplayHeight) { - let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {}, - width = {}, height = {}, autoSize = {}; - - let cwu = SpecialPowers.getDOMWindowUtils(window); - cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom, - minZoom, maxZoom, width, height, autoSize); - return { - defaultZoom: defaultZoom.value, - minZoom: minZoom.value, - maxZoom: maxZoom.value, - width: width.value, - height: height.value, - autoSize: autoSize.value, - allowZoom: allowZoom.value - }; - } - function nextTest() { if (tests.length) (tests.shift())(); diff --git a/dom/base/test/test_meta_viewport3.html b/dom/base/test/test_meta_viewport3.html index 5343c8eb58bb..00c38f02fffb 100644 --- a/dom/base/test/test_meta_viewport3.html +++ b/dom/base/test/test_meta_viewport3.html @@ -49,24 +49,6 @@ }); }); - function getViewportInfo(aDisplayWidth, aDisplayHeight) { - let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {}, - width = {}, height = {}, autoSize = {}; - - let cwu = SpecialPowers.getDOMWindowUtils(window); - cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom, - minZoom, maxZoom, width, height, autoSize); - return { - defaultZoom: defaultZoom.value, - minZoom: minZoom.value, - maxZoom: maxZoom.value, - width: width.value, - height: height.value, - autoSize: autoSize.value, - allowZoom: allowZoom.value - }; - } - function nextTest() { if (tests.length) (tests.shift())(); diff --git a/dom/base/test/test_meta_viewport4.html b/dom/base/test/test_meta_viewport4.html index 982c656523fd..f4ef4725d332 100644 --- a/dom/base/test/test_meta_viewport4.html +++ b/dom/base/test/test_meta_viewport4.html @@ -48,24 +48,6 @@ }); }); - function getViewportInfo(aDisplayWidth, aDisplayHeight) { - let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {}, - width = {}, height = {}, autoSize = {}; - - let cwu = SpecialPowers.getDOMWindowUtils(window); - cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom, - minZoom, maxZoom, width, height, autoSize); - return { - defaultZoom: defaultZoom.value, - minZoom: minZoom.value, - maxZoom: maxZoom.value, - width: width.value, - height: height.value, - autoSize: autoSize.value, - allowZoom: allowZoom.value - }; - } - function nextTest() { if (tests.length) (tests.shift())(); diff --git a/dom/base/test/test_meta_viewport5.html b/dom/base/test/test_meta_viewport5.html index 060998c2019c..fac5d03dba93 100644 --- a/dom/base/test/test_meta_viewport5.html +++ b/dom/base/test/test_meta_viewport5.html @@ -24,24 +24,6 @@ nextTest(); }); - function getViewportInfo(aDisplayWidth, aDisplayHeight) { - let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {}, - width = {}, height = {}, autoSize = {}; - - let cwu = SpecialPowers.getDOMWindowUtils(window); - cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom, - minZoom, maxZoom, width, height, autoSize); - return { - defaultZoom: defaultZoom.value, - minZoom: minZoom.value, - maxZoom: maxZoom.value, - width: width.value, - height: height.value, - autoSize: autoSize.value, - allowZoom: allowZoom.value - }; - } - function nextTest() { if (tests.length) (tests.shift())(); diff --git a/dom/base/test/test_meta_viewport6.html b/dom/base/test/test_meta_viewport6.html index 570fac5e48a3..de83c99f98a3 100644 --- a/dom/base/test/test_meta_viewport6.html +++ b/dom/base/test/test_meta_viewport6.html @@ -53,24 +53,6 @@ }); }); - function getViewportInfo(aDisplayWidth, aDisplayHeight) { - let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {}, - width = {}, height = {}, autoSize = {}; - - let cwu = SpecialPowers.getDOMWindowUtils(window); - cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom, - minZoom, maxZoom, width, height, autoSize); - return { - defaultZoom: defaultZoom.value, - minZoom: minZoom.value, - maxZoom: maxZoom.value, - width: width.value, - height: height.value, - autoSize: autoSize.value, - allowZoom: allowZoom.value - }; - } - function nextTest() { if (tests.length) (tests.shift())(); diff --git a/dom/base/test/test_meta_viewport7.html b/dom/base/test/test_meta_viewport7.html index 476e107796b7..c829d0ccd963 100644 --- a/dom/base/test/test_meta_viewport7.html +++ b/dom/base/test/test_meta_viewport7.html @@ -78,24 +78,6 @@ }); }); - function getViewportInfo(aDisplayWidth, aDisplayHeight) { - let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {}, - width = {}, height = {}, autoSize = {}; - - let cwu = SpecialPowers.getDOMWindowUtils(window); - cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom, - minZoom, maxZoom, width, height, autoSize); - return { - defaultZoom: defaultZoom.value, - minZoom: minZoom.value, - maxZoom: maxZoom.value, - width: width.value, - height: height.value, - autoSize: autoSize.value, - allowZoom: allowZoom.value - }; - } - function updateViewport(content) { let meta = document.querySelector("meta[name=viewport]"); meta.content = content; diff --git a/dom/base/test/viewport_helpers.js b/dom/base/test/viewport_helpers.js index 8ad9d2b398ac..04f9f02b5c4a 100644 --- a/dom/base/test/viewport_helpers.js +++ b/dom/base/test/viewport_helpers.js @@ -1,3 +1,21 @@ function scaleRatio(scale) { return {"set": [["layout.css.devPixelsPerPx", "" + scale]]}; } + +function getViewportInfo(aDisplayWidth, aDisplayHeight) { + let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {}, + width = {}, height = {}, autoSize = {}; + + let cwu = SpecialPowers.getDOMWindowUtils(window); + cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom, + minZoom, maxZoom, width, height, autoSize); + return { + defaultZoom: defaultZoom.value, + minZoom: minZoom.value, + maxZoom: maxZoom.value, + width: width.value, + height: height.value, + autoSize: autoSize.value, + allowZoom: allowZoom.value + }; +}