зеркало из https://github.com/mozilla/gecko-dev.git
Bug 947755, try to avoid use of setTimeout when there is an event to use, r=khuey
This commit is contained in:
Родитель
7c92933074
Коммит
9b0e1b6a77
|
@ -6,7 +6,6 @@
|
||||||
document.write("<h5 id='dynamic'>document.written content</h5>");
|
document.write("<h5 id='dynamic'>document.written content</h5>");
|
||||||
document.close();
|
document.close();
|
||||||
window.history.go(-1);
|
window.history.go(-1);
|
||||||
opener.setTimeout("isTestDynamic()", 2500);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
|
@ -14,6 +13,15 @@
|
||||||
setTimeout(run, 0);
|
setTimeout(run, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.addEventListener("pageshow",
|
||||||
|
function() {
|
||||||
|
++opener.file_document_write_1_loadCount;
|
||||||
|
if (opener.file_document_write_1_loadCount == 2) {
|
||||||
|
opener.setTimeout("isTestDynamic()", 0);
|
||||||
|
}
|
||||||
|
opener.ok(opener.file_document_write_1_loadCount <= 2);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="start();">
|
<body onload="start();">
|
||||||
|
|
|
@ -49,6 +49,7 @@ function nextTest_() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Needed by file_document_write_1.html
|
// Needed by file_document_write_1.html
|
||||||
|
window.file_document_write_1_loadCount = 0;
|
||||||
function isTestDynamic() {
|
function isTestDynamic() {
|
||||||
var dyn = testWindow.document.getElementById("dynamic");
|
var dyn = testWindow.document.getElementById("dynamic");
|
||||||
is(dyn, null, "Should have gone back to the static page!");
|
is(dyn, null, "Should have gone back to the static page!");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче