summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/autofocus-opera-001.html
blob: e8497c7acde612a0b5d4dd8bb9b57e55301b6e67 (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
<html>
<head>
<title>basic "autofocus" test</title>
<style>
 input { background:red }
 input:focus { background:lime }
</style>
<script language="JavaScript" type="text/javascript">
    function log(message) {
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
    }

    function test() {
        if (window.layoutTestController)
            layoutTestController.dumpAsText();
            
        if (document.activeElement == document.getElementsByTagName("input")[0])
            log("SUCCESS");
        else
            log("FAILURE");
    }
</script>
</head>
<body onload="test()">
<p>This form control should have a green background and active state: <input autofocus>
<hr>
<ol id="console"></ol>
</body>
</html>