summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/readonly-pseudoclass-opera-003.html
blob: 09fcc86b1d289a6fadbf7edc7d80decfbdf3bdfe (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
<html>
<head>
<title>"readonly" and elements it does not apply to</title>
<style>
 input:read-only { background:red }
 input { display: none }
 select:read-only { background:red }
 select { display: none }
 button:read-only { background:red }
 button { display: none }
</style>
<link rel="help" href="http://whatwg.org/specs/web-forms/current-work/#readonly">
<link rel="help" href="http://whatwg.org/specs/web-forms/current-work/#relation">
<script language="JavaScript" type="text/javascript">
    function log(message) {
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
    }

    function test() {
        if (window.testRunner)
            testRunner.dumpAsText();

        var i = document.getElementsByName("victim");
        for (c = 0; c < i.length; c++) {
            if (document.defaultView.getComputedStyle(i[c], null).getPropertyValue('display') == "none")
                log(c + ": SUCCESS");
            else
                log(c + ": FAILURE");
        }
    }
</script>
</head>
<body onload="test()">
<p>:read-only doesn't apply to following controls. Fails if FAILURE is shown somewhere.</p>
<input name="victim" type="radio" readonly>
<input name="victim" type="file" readonly>
<input name="victim" type="range" readonly disabled>
<input name="victim" type="button" readonly>
<input name="victim" type="submit" readonly>
<input name="victim" type="reset" readonly>
<select name="victim" readonly></select>
<button name="victim" readonly></button>
<button name="victim" readonly type="reset"></button>
<button name="victim" readonly type="submit"></button>
<hr>
<ol id="console"></ol>
</body>
</html>