4 https://bugzilla.mozilla.org/show_bug.cgi?id=337631
7 <title>Test for Bug
337631</title>
8 <script type=
"text/javascript" src=
"/MochiKit/MochiKit.js"></script>
9 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=337631">Mozilla Bug
337631</a>
17 <a href=
"foo" id=
"test4">foo
</a>
18 <input id=
"test1" value=
"test">
19 <p id=
"test2">adsf
<a href=
"#" id=
"test3">asdf
</a><input id=
"test5"></p>
23 <script class=
"testbody" type=
"text/javascript">
25 /** Test for Bug
337631 **/
27 function getActiveElement()
31 var el = document.activeElement;
37 if (el && el != document.documentElement) {
42 rv =
"[no permission]";
56 while (el && el != document.documentElement) {
61 rv +=
"[no permission]";
82 is(getActiveElement(),
"INPUT in DIV in BODY",
"getActiveElement tests");
85 is(getActiveElement(),
"INPUT in DIV in BODY",
"getActiveElement tests");
88 is(getActiveElement(),
"A in P in DIV in BODY",
"getActiveElement tests");
91 is(getActiveElement(),
"A in DIV in BODY",
"getActiveElement tests");
94 is(getActiveElement(),
"INPUT in P in DIV in BODY",
"getActiveElement tests");