summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/autofocus-opera-001.html
blob: f19161ccd604b885fc5040f1c21d20b1ce5a13d3 (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
<html>
<head>
<title>basic "autofocus" test</title>
<style>
 input { background:red }
 input:focus { background:lime }
</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.getElementsByTagName("input")[0])
            log("SUCCESS");
        else
            log("FAILURE");
        if (window.testRunner)
            testRunner.notifyDone();
    }

    waitUntilLoadedAndAutofocused(test);
</script>
</head>
<body>
<p>This form control should have a green background and active state: <input autofocus>
<hr>
<ol id="console"></ol>
</body>
</html>