Bug 1776680 [wpt PR 34603] - [@container] Test invalidation of font-relative units...
[gecko.git] / dom / events / test / test_bug226361.xhtml
blob143a48575764b60993e73633e7e1ba9f0e0ed226
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <!--
3 https://bugzilla.mozilla.org/show_bug.cgi?id=226361
4 -->
5 <head>
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"/>
10 </head>
11 <body id="body1">
12 <p id="display">
14 <a id="b1" tabindex="1" href="http://home.mozilla.org">start</a><br />
15 <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>
21 </p>
22 <div id="content" style="display: none">
24 </div>
25 <pre id="test">
26 <script type="application/javascript">
27 <![CDATA[
29 /** Test for Bug 226361 **/
31 // accessibility.tabfocus must be set to value 7 before running test also
32 // on a mac.
33 function setTabFocus() {
34 SpecialPowers.pushPrefEnv({ set: [[ "accessibility.tabfocus", 7 ]] }, doTest);
37 // =================================
39 var doc = document;
40 function tab_to(id) {
41 synthesizeKey("KEY_Tab", {});
42 is(doc.activeElement.id, id, "element with id=" + id + " should have focus");
45 function tab_iframe() {
46 doc = document;
47 tab_to('iframe');
49 // inside iframe
50 doc = document.getElementById('iframe').contentDocument
51 tab_to('a3');tab_to('a5');tab_to('a1');tab_to('a2');tab_to('a4');
55 function doTest() {
56 window.getSelection().removeAllRanges();
57 document.getElementById('body1').focus();
58 is(document.activeElement.id, document.body.id, "body element should be focused");
60 doc = document;
61 tab_to('b1');
63 tab_iframe();
65 doc=document
66 document.getElementById('iframe').focus()
67 tab_to('b2');
68 // Change tabindex so the next TAB goes back to the IFRAME
69 document.getElementById('iframe').setAttribute('tabindex','4');
71 tab_iframe();
72 SimpleTest.finish();
75 SimpleTest.waitForExplicitFinish();
76 addLoadEvent(setTabFocus);
78 ]]>
79 </script>
80 </pre>
81 </body>
82 </html>