Rubber-stamped by Brady Eidson.
[webbrowser.git] / LayoutTests / fast / forms / autofocus-opera-002.html
blob93c600ff0c66ee6da633c9c5dd7a1d2acf34ce8d
1 <html>
2 <head>
3 <title>dynamically inserted control with "autofocus" set</title>
4 <style>
5 input { background:red }
6 input:focus { background:lime }
7 </style>
8 <script language="JavaScript" type="text/javascript">
9 function log(message) {
10 document.getElementById("console").innerHTML += "<li>"+message+"</li>";
13 function test() {
14 if (window.layoutTestController)
15 layoutTestController.dumpAsText();
17 if (document.activeElement == document.getElementsByTagName("input")[0])
18 log("SUCCESS");
19 else
20 log("FAILURE");
22 </script>
23 </head>
24 <body onload="test()">
25 <p>FAIL (The script did not run.)</p>
26 <script>
27 document.getElementsByTagName('p')[0].innerHTML = "This form control should have a green background: <input autofocus>";
28 </script>
29 <hr>
30 <ol id="console"></ol>
31 </body>
32 </html>