4 https://bugzilla.mozilla.org/show_bug.cgi?id=402680
7 <title>Test for Bug
402680</title>
9 var activeElementIsNull
= (document
.activeElement
== null);
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" />
16 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=402680">Mozilla Bug
402680</a>
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];
35 ok(document.activeElement == input,
36 "Input element isn't the active element!");
37 var textarea = document.getElementsByTagName(
"textarea")[
0];
39 ok(document.activeElement == textarea,
40 "Textarea element isn't the active element!");
44 SimpleTest.waitForExplicitFinish();
45 addLoadEvent(testActiveElement);