Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLImageElement / image-natural-width-height.html
blob1f82bb0c53274df8fbcb680c3415e035b3a90b7b
1 <html>
2 <script>
3 function runTest()
5 if (window.testRunner)
6 testRunner.dumpAsText();
8 var result = document.getElementById('result');
10 var i1 = document.getElementById('image1');
11 if (i1.naturalWidth != 75 || i1.naturalHeight != 25)
12 return;
14 var i2 = document.getElementById('image2');
15 if (i2.naturalWidth != 75 || i2.naturalHeight != 25)
16 return;
18 var i3 = document.getElementById('image3');
19 if (i3.naturalWidth != 0 || i3.naturalHeight != 0)
20 return;
22 var i4 = document.getElementById('image4');
23 if (i4.naturalWidth != 0 || i4.naturalHeight != 0)
24 return;
26 result.innerHTML = 'SUCCESS';
28 </script>
30 <body onload="runTest()">
31 <img id="image1" src="resources/blue_rect.jpg">
32 <img id="image2" width="10" height="10" src="resources/blue_rect.jpg">
33 <img id="image3" src="non-existent.jpg">
34 <img id="image4" src="non-existent.jpg" width="10" height="10">
35 <div>This tests that the naturalWidth and naturalHeight HTMLImageElement properties work correctly.</div>
36 <div id="result">FAILURE</div>
37 </body>
38 </html>