4 https://bugzilla.mozilla.org/show_bug.cgi?id=466586
7 <title>Test for Bug
466586</title>
8 <script type=
"application/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
12 <body onload=
"loadSmall();">
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=89419">Mozilla Bug
466586</a>
15 <div id=
"content" style=
"display: none">
16 <img id=
"big" src=
"big.png"/>
19 <script type=
"application/javascript">
21 SimpleTest.waitForExplicitFinish();
23 var jsBig = new Image();
25 // We have loaded the large png with id
"big". We want to test if it will be
26 // kicked out of the cache and thus have to be reloaded, but to ensure that, we
27 // need to get the cache to look at what is there. So we load another image,
31 // Trivial check, for reference.
32 is(document.getElementById(
"big").width,
3000,
33 "HTML 'big' image width after page onload()");
35 var small = new Image();
36 small.onload = smallLoaded;
37 small.src =
"red.png";
40 function smallLoaded()
42 jsBig.src = document.getElementById(
"big").src;
43 // Check that it is not needed to wait for onload().
44 is(jsBig.width,
3000,
"JS 'big' image width before its onload()");
45 // Check again after onload(), for reference.
46 jsBig.onload = jsBigLoaded;
49 function jsBigLoaded()
51 is(jsBig.width,
3000,
"JS 'big' image width after its onload()");