Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / html / document / test / test_bug402680.html
blob1b561dd4c8faa432232095a93ccad3bf4f79bf69
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=402680
5 -->
6 <head>
7 <title>Test for Bug 402680</title>
8 <script>
9 var activeElementIsNull = (document.activeElement == null);
10 </script>
11 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
12 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
13 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
14 </head>
15 <body>
16 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=402680">Mozilla Bug 402680</a>
17 <p id="display"></p>
18 <div id="content">
19 <input type="text">
20 <textarea></textarea>
21 </div>
22 <pre id="test">
23 <script class="testbody" type="text/javascript">
25 /** Test for Bug 402680 **/
27 ok(activeElementIsNull,
28 "Before document has body, active element should be null");
30 function testActiveElement() {
31 ok(document.body == document.activeElement,
32 "After page load body element should be the active element!");
33 var input = document.getElementsByTagName("input")[0];
34 input.focus();
35 ok(document.activeElement == input,
36 "Input element isn't the active element!");
37 var textarea = document.getElementsByTagName("textarea")[0];
38 textarea.focus();
39 ok(document.activeElement == textarea,
40 "Textarea element isn't the active element!");
41 SimpleTest.finish();
44 SimpleTest.waitForExplicitFinish();
45 addLoadEvent(testActiveElement);
47 </script>
48 </pre>
49 </body>
50 </html>