summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/autofocus-opera-006.html
blob: 556a5fe81b9b51e76de25b4d09d7d5e586623f5b (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
<html>
<head>
<title>test with multiple controls having "autofocus" set</title>
<style>
 input, input#test:focus { background:lime }
 input:focus, input#test { background:red }
</style>
<script src="resources/common.js"></script>
<script language="JavaScript" type="text/javascript">
    function log(message) {
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
    }

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

        if (document.activeElement == document.getElementById("test"))
            log("SUCCESS");
        else
            log("FAILURE");
        if (window.testRunner)
            testRunner.notifyDone();
    }

    waitUntilLoadedAndAutofocused(test);
</script>
</head>
<body>
<p>All form controls below should have a green background:</p>
<p><input autofocus id="test">
<p><input autofocus>
<p><input autofocus>
<p><input>
<p><input autofocus>
<p><input>
<hr/>
<ol id="console"></ol>
</body>
</html>