зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
e7926bf434
Коммит
128fc55f89
|
@ -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);
|
||||
})();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче