gecko/content/base/test/test_bug461555.html

65 lines
1.5 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=461555
-->
<head>
<title>Test for Bug 461555</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=461555">Mozilla Bug 461555</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<script>
SimpleTest.waitForExplicitFinish();
function writeIt(n) {
document.write("<span>" + n + "</span>");
}
var recur = 0;
function externalScript() {
if (++recur == 3) {
return;
}
base = (recur-1) * 4
writeIt(6 + base);
s = document.createElement("script");
s.src = "data:text/plain,writeIt(" + (8+base) + ");writeIt(" + (9+base) + ");externalScript();";
document.body.appendChild(s);
writeIt(7 + base);
}
function done() {
nodes = document.getElementsByTagName('span');
is(nodes.length, 13, "wrong length");
for (i = 0; i < nodes.length; ++i) {
is(nodes[i].textContent, i+1, "wrong order");
}
SimpleTest.finish();
}
document.addEventListener("DOMContentLoaded", function() {
done();
}, false);
writeIt(1);
</script>
<script defer>
writeIt(3);
</script>
<script>
writeIt(2);
</script>
<script defer src="data:text/plain,writeIt(4);writeIt(5);"></script>
<script defer src="data:text/plain,externalScript();"></script>