Bug 961215 - Fix intermittent browser_tabview_bug625269.js failures by taking into account that window.resizeTo() can fail to change the window size sometimes r=MattN

This commit is contained in:
Tim Taubert 2015-05-07 20:27:52 +02:00
Родитель e7926bf434
Коммит 128fc55f89
1 изменённых файлов: 10 добавлений и 5 удалений

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

@ -66,11 +66,16 @@ function resizeWindow(win, diffX, diffY, callback) {
(function tryResize() {
let {outerWidth: width, outerHeight: height} = win;
if (width != targetWidth || height != targetHeight) {
win.resizeTo(targetWidth, targetHeight);
executeSoon(tryResize);
} else {
callback();
if (width == targetWidth && height == targetHeight) {
executeSoon(callback);
return;
}
win.addEventListener("resize", function onResize() {
win.removeEventListener("resize", onResize);
executeSoon(tryResize);
});
win.resizeTo(targetWidth, targetHeight);
})();
}