39 lines
2.0 KiB
HTML
39 lines
2.0 KiB
HTML
<html>
|
|
<title></title>
|
|
<style>
|
|
img { font-size: 0px; }
|
|
</style>
|
|
<body onload="runTest()">
|
|
QUIRKS 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 alt="" src="brokenimage.jpg"><span id=result4></span>
|
|
<br><br>
|
|
4. 'alt' attribute is set to empty value but other attributes/properties prevent collapsing (image box should not collapse):<br>
|
|
<img id=image5 alt="" style="display: block; width; 20px; height: 20px" src="brokenimage.jpg">image box is blockified: <span id=result5></span><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>
|