gecko-dev/dom/html/test/test_img_complete.html

38 lines
1.1 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=608261
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 608261</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for Bug 608261 **/
SimpleTest.waitForExplicitFinish();
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=608261">Mozilla Bug 608261</a>
<p id="display"><img src="image.png"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
addLoadEvent(function() {
var img = document.querySelector("img");
ok(img.complete, "By onload, image should have loaded");
img.src = "image.png?cachebust";
ok(!img.complete, "Now that we're loading we should no longer be complete");
img.onload = function() {
ok(img.complete, "The new thing should have loaded.");
SimpleTest.finish();
}
});
</script>
</pre>
</body>
</html>