summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/percent-min-width-img-src-change.html
blob: b001a9b0c2fd0a4df000b3473799704c69333744 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var completed = 0, failures = 0, failuresDetail = ""; 
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}
function printResult() {
    document.getElementById("result").innerText = failures ? "FAIL: " + failures + " cases failed\n" + failuresDetail : "PASS";
    if (window.testRunner)
        testRunner.notifyDone();
}

function imageCheckForMin(image) {
    if (image.src.match("greenbox-100px.png")  != null) {
        image.src = "resources/greenbox.png";
    }
    else {
        ++completed;
        if (image.width != 25) {
            ++failures; 
            failuresDetail +=  image.id + ": " + image.width + " (expected: " + 25 + ")\n";
        }
        if (completed == 2)
             printResult();
    }
}
</script>
</head>

<body>
<div id="result"></div>
<table>
<tbody>
<tr>
<td>
<img id="percentMinWidthInTable" style="min-width:100%;" src="resources/greenbox-100px.png" onload="imageCheckForMin(this)">
</td>
</tr>
</tbody>
</table>
<div style="position:absolute;top:200px;left:11px">
<img id="percentMinWidthInAbsolute" style="min-width:100%;" src="resources/greenbox-100px.png" onload="imageCheckForMin(this)">
</div>
</body>
</html>