1 <html xmlns=
"http://www.w3.org/1999/xhtml">
3 https://bugzilla.mozilla.org/show_bug.cgi?id=226361
6 <title>Test for Bug
226361</title>
7 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
8 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
14 <a id=
"b1" tabindex=
"1" href=
"http://home.mozilla.org">start
</a><br />
17 <iframe id=
"iframe" tabindex=
"2" src=
"bug226361_iframe.xhtml"></iframe>
19 <a id=
"b2" tabindex=
"3" href=
"http://home.mozilla.org">end
</a>
22 <div id=
"content" style=
"display: none">
26 <script type=
"application/javascript">
29 /** Test for Bug
226361 **/
31 // accessibility.tabfocus must be set to value
7 before running test also
33 function setTabFocus() {
34 SpecialPowers.pushPrefEnv({ set: [[
"accessibility.tabfocus",
7 ]] }, doTest);
37 // =================================
41 synthesizeKey(
"KEY_Tab", {});
42 is(doc.activeElement.id, id,
"element with id=" + id +
" should have focus");
45 function tab_iframe() {
50 doc = document.getElementById('iframe').contentDocument
51 tab_to('a3');tab_to('a5');tab_to('a1');tab_to('a2');tab_to('a4');
56 window.getSelection().removeAllRanges();
57 document.getElementById('body1').focus();
58 is(document.activeElement.id, document.body.id,
"body element should be focused");
66 document.getElementById('iframe').focus()
68 // Change tabindex so the next TAB goes back to the IFRAME
69 document.getElementById('iframe').setAttribute('tabindex','
4');
75 SimpleTest.waitForExplicitFinish();
76 addLoadEvent(setTabFocus);