Bug 960309, make browser_tabview_bug625269.js more reliable, r=roc

--HG--
extra : rebase_source : 0a5ac4d8578ea73d1fc0d6a5c6e90651a1a4418d
This commit is contained in:
Olli Pettay 2014-01-16 15:37:16 +02:00
Родитель 9910bea99a
Коммит f593bb23c9
1 изменённых файлов: 8 добавлений и 9 удалений

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

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