Add @page margin support
[WebKit-https.git] / LayoutTests / loader / reload-subresource-when-type-changes.html
1 <div id="logDiv">FAILED</div>
2 <script>
3 if (window.testRunner)
4     testRunner.dumpAsText();
5
6 var logDiv = document.getElementById("logDiv");
7
8 function clearLog()
9 {
10     logDiv.innerHTML = "";
11 }
12
13 function log(string)
14 {
15     logDiv.appendChild(document.createTextNode(string));
16     logDiv.appendChild(document.createElement("br"));
17 }
18
19 var loaded = 0;
20 var messages = [];
21
22 function checkLoadedImage(event, testNumber) {
23     var imageWidth = event.target.width;
24     if (imageWidth == 25)
25         resourceLoaded("PASS ", testNumber);
26     else
27         resourceLoaded("IMAGE SIZE " + imageWidth + " FAIL - ", testNumber);
28 }
29
30 function resourceLoaded(message, testNumber) {
31     messages[testNumber] = message + testNumber + " of 3";
32     if (++loaded == 3) {
33         for (var i = 1; i <= 3; i++)
34             log(messages[i]);
35     }
36 }
37 </script>
38
39 <img src="resources/reload-subresource-when-type-changes.js">
40 <script src="resources/reload-subresource-when-type-changes.js"></script>
41
42 <link rel="prefetch" href="resources/image1.png">
43 <img src="resources/image1.png" onerror="log('LOAD ERROR - FAIL 2 of 3)" onload="checkLoadedImage(event, 2)">
44
45 <script src="resources/image2.png"></script>
46 <img src="resources/image2.png" onerror="log('LOAD ERROR - FAIL 2 of 3)" onload="checkLoadedImage(event, 3)">