Bug 1880216 - Migrate Fenix docs into Sphinx. r=owlish,geckoview-reviewers,android...
[gecko.git] / dom / events / test / test_bug586961.xhtml
blobebdcc248d6f6cb5dab15be304bbf2f948ffe6db8
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
4 <!--
5 https://bugzilla.mozilla.org/show_bug.cgi?id=586961
6 -->
7 <window title="Mozilla Bug 586961"
8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
10 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
11 <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
12 <body xmlns="http://www.w3.org/1999/xhtml">
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=586961">Mozilla Bug 586961</a>
15 <p id="display"></p>
16 <div id="content" style="display: none">
17 </div>
18 </body>
20 <box onclick="clicked(event)">
21 <label id="controllabel" control="controlbutton" accesskey="k" value="Click here" />
22 <button id="controlbutton" label="Button" />
23 </box>
25 <script class="testbody" type="application/javascript"><![CDATA[
27 /** Test for Bug 586961 **/
29 function clicked(event) {
30 is(event.target.id, "controlbutton", "Accesskey was directed to controlled element.");
31 SimpleTest.finish();
34 function test() {
35 var accessKeyDetails = (navigator.platform.includes("Mac")) ?
36 { altKey : true, ctrlKey : true } :
37 { altKey : true, shiftKey: true };
38 synthesizeKey("k", accessKeyDetails);
41 SimpleTest.waitForExplicitFinish();
42 SimpleTest.waitForFocus(test, window);
44 ]]></script>
46 </window>