mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
9191fc7264
commit
7740e246cf
@ -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);
|
||||
})();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user