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
This commit is contained in:
Hiroyuki Ikezoe 2018-10-15 23:53:43 +00:00
Родитель 1850f573a5
Коммит c43cc6396c
9 изменённых файлов: 18 добавлений и 144 удалений

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

@ -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())();

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

@ -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())();

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

@ -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())();

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

@ -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())();

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

@ -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())();

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

@ -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())();

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

@ -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())();

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

@ -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;

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

@ -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
};
}