mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Attempt to fix bug 681138 by making the test loading not race against snapshotting and focusing the iframe
This commit is contained in:
parent
baf4a980ad
commit
db9b3860a7
@ -47,15 +47,19 @@ function doSnapShot(iframe) {
|
||||
callbackTestCanvas(iframe);
|
||||
};
|
||||
|
||||
function remotePageLoaded() {
|
||||
function remotePageLoaded(callback) {
|
||||
var iframe = this;
|
||||
setTimeout(function(){doSnapShot(iframe);}, 0)
|
||||
setTimeout(function(){
|
||||
doSnapShot(iframe);
|
||||
callback();
|
||||
}, 0);
|
||||
};
|
||||
|
||||
const MAX_ITERATIONS = 1000;
|
||||
|
||||
function createIframe(url,next) {
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.focus();
|
||||
iframe.src = url;
|
||||
iframe.remotePageLoaded = remotePageLoaded;
|
||||
var me = this;
|
||||
@ -71,8 +75,11 @@ function createIframe(url,next) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
iframe.remotePageLoaded();
|
||||
if (next) setTimeout(function(){createIframe(next,null);}, 0)
|
||||
iframe.remotePageLoaded(function() {
|
||||
if (next) {
|
||||
setTimeout(function(){createIframe(next,null);}, 0)
|
||||
}
|
||||
});
|
||||
}
|
||||
iframe.addEventListener("load", iframeLoadCompleted, false);
|
||||
window.document.body.appendChild(iframe);
|
||||
|
Loading…
Reference in New Issue
Block a user