OLD | NEW |
1 <?php | 1 <?php |
2 header("Link: <http://127.0.0.1:8000/resources/square.png>;rel=preload;as=im
age;", false); | 2 header("Link: <http://127.0.0.1:8000/resources/square.png>;rel=preload;as=im
age;", false); |
3 ?> | 3 ?> |
4 <!DOCTYPE html> | 4 <!DOCTYPE html> |
| 5 <!-- Test that |
| 6 (1) the URL specified in the link header is preloaded, and |
| 7 (2) isPreloaded() returns true before, in, and after document's load event. |
| 8 --> |
5 <script> | 9 <script> |
| 10 function test() { |
6 if (window.internals) { | 11 if (window.internals) { |
7 if (internals.isPreloaded("http://127.0.0.1:8000/resources/square.png")) | 12 if (internals.isPreloaded("http://127.0.0.1:8000/resources/square.png")) |
8 top.postMessage("squareloaded", "*"); | 13 top.postMessage("squareloaded", "*"); |
9 else | 14 else |
10 top.postMessage("notloaded", "*"); | 15 top.postMessage("notloaded", "*"); |
11 } | 16 } |
| 17 } |
| 18 function onLoad() { |
| 19 test(); |
| 20 setTimeout(test, 100); |
| 21 } |
| 22 test(); |
12 </script> | 23 </script> |
13 | 24 <body onload="onLoad()"> |
| 25 </body> |
OLD | NEW |