Home | History | Annotate | Download | only in HTMLLinkElement
      1 <html>
      2 <body>
      3 <script>
      4 function log(message)
      5 {
      6     var item = document.createElement("li");
      7     item.appendChild(document.createTextNode(message));
      8     document.getElementById("console").appendChild(item);
      9 }
     10 
     11 nick_load_count = 0
     12 
     13 function nick_onload()
     14 {
     15     log("NICK_ONLOAD called");
     16     ++nick_load_count;
     17     if (nick_load_count == 2) {
     18         log("SUCCESS.  Two loads.");
     19         layoutTestController.notifyDone();
     20     }
     21 }
     22 
     23 if (window.layoutTestController) {
     24     layoutTestController.waitUntilDone();
     25     layoutTestController.dumpAsText();
     26     layoutTestController.dumpResourceResponseMIMETypes();
     27 }
     28 </script>
     29 <p>This test verifies that an image which is prefetched, and which is also contained as a
     30 subresource of the current document can be loaded correctly as a subresource.  See
     31 bug 49236 in which this wasn't working.
     32 <p>When this test succeeds, you'll see an image of Nick on a sailboat immediately below
     33 this text.  When this test fails, you will see no images at all.
     34 <link rel="prefetch" href="resources/nick.jpg" onload="nick_onload()" />
     35 <img src="resources/nick.jpg" onload="nick_onload()" />
     36 <hr>
     37 <p><ol id="console"></ol></p>
     38 </body></html>
     39 
     40