blob: 18a3daf435a3211015bff48790fddf40edd4f6d4 [file] [log] [blame]
<!DOCTYPE html>
<html>
<title></title>
<head>
<style>
img { font-size: 0px; }
</style>
</head>
<body onload="runTest()">
STANDARDS mode.<br><br>
1. 'alt' attribute is not set (image box should not collapse):<br>
<img id=image1 src="brokenimage.jpg"> <span id=result1></span>
<br><br>
2. 'alt' attribute is set to a non-empty value (image box should not collapse):<br>
<img id=image2 alt=" " src="brokenimage.jpg"> <span id=result2></span> <img id=image3 alt="text" src="brokenimage.jpg"> <span id=result3></span>
<br><br>
3. 'alt' attribute is set to empty value (image box should collapse):<br>
<img id=image4 id=collapsed1 alt="" src="brokenimage.jpg"> <span id=result4></span>
<br><br>
4. 'alt' attribute is set to empty value on a blockified image (image box should not collapse):<br>
<img id=image5 alt="" style="display: block; width; 20px; height: 20px" src="brokenimage.jpg"> <span id=result5></span><br>
<br>
5. 'alt' attribute is set to empty value and width/height values are set (image box should collapse):<br>
<img id=image6 alt="" width=20 src="brokenimage.jpg">width attribute is set: <span id=result6></span><br>
<img id=image7 alt="" height=20 src="brokenimage.jpg">height attribute is set: <span id=result7></span><br>
<img id=image8 alt="" width=20 height=20 src="brokenimage.jpg">width and height attributes are set: <span id=result8></span><br>
<img id=image9 alt="" style="width: 20px;" src="brokenimage.jpg">inline style with width set: <span id=result9></span><br>
<img id=image10 alt="" style="height: 20px;" src="brokenimage.jpg">inline style with height set: <span id=result10></span><br>
<img id=image11 alt="" style="width: 20px; height: 20px;" src="brokenimage.jpg">inline style with width and height: <span id=result11></span><br>
<script>
function runTest() {
if (window.testRunner)
testRunner.dumpAsText();
let numberOfImages = 11;
for (let i = 1; i <= numberOfImages; ++i) {
let imageElement = document.getElementById("image" + i);
let resultElement = document.getElementById("result" + i);
resultElement.innerHTML = imageElement.offsetWidth + "px " + imageElement.offsetHeight + "px";
}
}
</script>
</body>
</html>