6 testRunner
.dumpAsText();
8 var result
= document
.getElementById('result');
10 var i1
= document
.getElementById('image1');
11 if (i1
.naturalWidth
!= 75 || i1
.naturalHeight
!= 25)
14 var i2
= document
.getElementById('image2');
15 if (i2
.naturalWidth
!= 75 || i2
.naturalHeight
!= 25)
18 var i3
= document
.getElementById('image3');
19 if (i3
.naturalWidth
!= 0 || i3
.naturalHeight
!= 0)
22 var i4
= document
.getElementById('image4');
23 if (i4
.naturalWidth
!= 0 || i4
.naturalHeight
!= 0)
26 result
.innerHTML
= 'SUCCESS';
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>