Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 <html>
3 <head>
4 <title>Accessible document focus event testing</title>
6 <link rel="stylesheet" type="text/css"
7 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
9 <script type="application/javascript"
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
11 <script type="application/javascript"
12 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
14 <script type="application/javascript"
15 src="../common.js"></script>
16 <script type="application/javascript"
17 src="../events.js"></script>
18 <script type="application/javascript"
19 src="../role.js"></script>
20 <script type="application/javascript"
21 src="../states.js"></script>
23 <script type="application/javascript">
24 var gQueue = null;
26 //var gA11yEventDumpID = "eventdump";
27 //gA11yEventDumpToConsole = true;
29 function doTests()
30 {
31 // setup
32 var frameDoc = document.getElementById("iframe").contentDocument;
33 frameDoc.designMode = "on";
34 var frameDocAcc = getAccessible(frameDoc, [nsIAccessibleDocument]);
35 var buttonAcc = getAccessible("b1");
37 var frame2Doc = document.getElementById("iframe2").contentDocument;
38 var frame2Input = frame2Doc.getElementById("input");
39 var frame2DocAcc = getAccessible(frame2Doc);
40 var frame2InputAcc = getAccessible(frame2Input);
42 // Test focus events.
43 gQueue = new eventQueue();
45 // try to give focus to contentEditable frame twice to cover bug 512059
46 gQueue.push(new synthFocus(buttonAcc));
47 gQueue.push(new synthTab(frameDocAcc, new focusChecker(frameDocAcc)));
48 gQueue.push(new synthFocus(buttonAcc));
49 gQueue.push(new synthTab(frameDocAcc, new focusChecker(frameDocAcc)));
51 // focus on not editable document
52 gQueue.push(new synthFocus(frame2InputAcc));
53 gQueue.push(new synthShiftTab(frame2DocAcc, new focusChecker(frame2DocAcc)));
55 gQueue.invoke(); // Will call SimpleTest.finish();
56 }
58 SimpleTest.waitForExplicitFinish();
59 addA11yLoadEvent(doTests);
60 </script>
61 </head>
63 <body>
65 <a target="_blank"
66 href="https://bugzilla.mozilla.org/show_bug.cgi?id=512058"
67 title="Can't set focus to designMode document via accessibility APIs">
68 Mozilla Bug 512058
69 </a>
70 <a target="_blank"
71 href="https://bugzilla.mozilla.org/show_bug.cgi?id=512059"
72 title="Accessibility focus event never fired for designMode document after the first focus">
73 Mozilla Bug 512059
74 </a>
75 <a target="_blank"
76 href="https://bugzilla.mozilla.org/show_bug.cgi?id=618046"
77 title="No focus change event when Shift+Tab at top of screen">
78 Mozilla Bug 618046
79 </a>
81 <p id="display"></p>
82 <div id="content" style="display: none"></div>
83 <pre id="test">
84 </pre>
86 <div id="eventdump"></div>
88 <div id="testContainer">
89 <button id="b1">a button</button>
90 <iframe id="iframe" src="about:blank"></iframe>
91 <button id="b2">a button</button>
92 <iframe id="iframe2" src="data:text/html,<html><input id='input'></html>"></iframe>
93 </div>
94 </body>
95 </html>