accessible/tests/mochitest/states/test_visibility.xul

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <?xml version="1.0"?>
michael@0 2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
michael@0 3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
michael@0 4 type="text/css"?>
michael@0 5
michael@0 6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
michael@0 7 title="XUL elements visibility states testing">
michael@0 8
michael@0 9 <script type="application/javascript"
michael@0 10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
michael@0 11
michael@0 12 <script type="application/javascript"
michael@0 13 src="../common.js" />
michael@0 14 <script type="application/javascript"
michael@0 15 src="../role.js" />
michael@0 16 <script type="application/javascript"
michael@0 17 src="../states.js" />
michael@0 18 <script type="application/javascript"
michael@0 19 src="../events.js" />
michael@0 20
michael@0 21 <script type="application/javascript">
michael@0 22 <![CDATA[
michael@0 23 function openMenu(aID, aSubID, aOffscreenSubID)
michael@0 24 {
michael@0 25 this.menuNode = getNode(aID);
michael@0 26
michael@0 27 this.eventSeq = [
michael@0 28 new invokerChecker(EVENT_FOCUS, this.menuNode)
michael@0 29 ];
michael@0 30
michael@0 31 this.invoke = function openMenu_invoke()
michael@0 32 {
michael@0 33 this.menuNode.open = true;
michael@0 34 }
michael@0 35
michael@0 36 this.finalCheck = function openMenu_finalCheck()
michael@0 37 {
michael@0 38 testStates(aID, 0, 0, STATE_INVISIBLE | STATE_OFFSCREEN);
michael@0 39 testStates(aSubID, 0, 0, STATE_INVISIBLE | STATE_OFFSCREEN);
michael@0 40 if (aOffscreenSubID)
michael@0 41 testStates(aOffscreenSubID, STATE_OFFSCREEN, 0, STATE_INVISIBLE);
michael@0 42 }
michael@0 43
michael@0 44 this.getID = function openMenu_invoke()
michael@0 45 {
michael@0 46 return "open menu '" + aID + "' and test states";
michael@0 47 }
michael@0 48 }
michael@0 49
michael@0 50 function closeMenu(aID, aSubID, aSub2ID)
michael@0 51 {
michael@0 52 this.menuNode = getNode(aID);
michael@0 53
michael@0 54 this.eventSeq = [
michael@0 55 new invokerChecker(EVENT_FOCUS, document)
michael@0 56 ];
michael@0 57
michael@0 58 this.invoke = function openMenu_invoke()
michael@0 59 {
michael@0 60 this.menuNode.open = false;
michael@0 61 }
michael@0 62
michael@0 63 this.finalCheck = function openMenu_finalCheck()
michael@0 64 {
michael@0 65 testStates(aID, 0, 0, STATE_INVISIBLE | STATE_OFFSCREEN);
michael@0 66 testStates(aSubID, STATE_INVISIBLE, 0, STATE_OFFSCREEN);
michael@0 67 testStates(aSub2ID, STATE_INVISIBLE, 0, STATE_OFFSCREEN);
michael@0 68 }
michael@0 69
michael@0 70 this.getID = function openMenu_invoke()
michael@0 71 {
michael@0 72 return "open menu and test states";
michael@0 73 }
michael@0 74 }
michael@0 75
michael@0 76 var gQueue = null;
michael@0 77 function doTest()
michael@0 78 {
michael@0 79 testStates("deck_pane2", 0, 0, STATE_INVISIBLE | STATE_OFFSCREEN);
michael@0 80 testStates("tabs_pane1", 0, 0, STATE_INVISIBLE | STATE_OFFSCREEN);
michael@0 81 testStates("tabs_pane2", STATE_OFFSCREEN, 0, STATE_INVISIBLE);
michael@0 82
michael@0 83 gQueue = new eventQueue();
michael@0 84 gQueue.push(new openMenu("mi_file1", "mi_file1.1"));
michael@0 85 gQueue.push(new openMenu("mi_file1.2", "mi_file1.2.1", "mi_file1.2.4"));
michael@0 86 gQueue.push(new closeMenu("mi_file1", "mi_file1.1", "mi_file1.2.1"));
michael@0 87 gQueue.invoke(); // Will call SimpleTest.finish();
michael@0 88 }
michael@0 89
michael@0 90 SimpleTest.waitForExplicitFinish();
michael@0 91 addA11yLoadEvent(doTest);
michael@0 92 ]]>
michael@0 93 </script>
michael@0 94
michael@0 95 <hbox flex="1" style="overflow: auto;">
michael@0 96 <body xmlns="http://www.w3.org/1999/xhtml">
michael@0 97 <a target="_blank"
michael@0 98 href="https://bugzilla.mozilla.org/show_bug.cgi?id=810260"
michael@0 99 title="xul:deck hidden pages shouldn't be offscreen">
michael@0 100 Mozilla Bug 810260
michael@0 101 </a>
michael@0 102 <a target="_blank"
michael@0 103 href="https://bugzilla.mozilla.org/show_bug.cgi?id=865591"
michael@0 104 title="Visible menu item have offscreen state">
michael@0 105 Mozilla Bug 865591
michael@0 106 </a>
michael@0 107
michael@0 108 <p id="display"></p>
michael@0 109 <div id="content" style="display: none">
michael@0 110 </div>
michael@0 111 <pre id="test">
michael@0 112 </pre>
michael@0 113 </body>
michael@0 114
michael@0 115 <vbox flex="1">
michael@0 116
michael@0 117 <deck selectedIndex="1">
michael@0 118 <description value="This is the first page" id="deck_pane1"/>
michael@0 119 <button label="This is the second page" id="deck_pane2"/>
michael@0 120 </deck>
michael@0 121
michael@0 122 <tabbox>
michael@0 123 <tabs>
michael@0 124 <tab>tab1</tab>
michael@0 125 <tab>tab2</tab>
michael@0 126 </tabs>
michael@0 127 <tabpanels>
michael@0 128 <description value="This is the first page" id="tabs_pane1"/>
michael@0 129 <button label="This is the second page" id="tabs_pane2"/>
michael@0 130 </tabpanels>
michael@0 131 </tabbox>
michael@0 132
michael@0 133 <menubar>
michael@0 134 <menu label="File" id="mi_file1">
michael@0 135 <menupopup>
michael@0 136 <menuitem label="SubFile" id="mi_file1.1"/>
michael@0 137 <menu label="SubFile2" id="mi_file1.2">
michael@0 138 <menupopup style="max-height: 5em;">
michael@0 139 <menuitem label="SubSubFile" id="mi_file1.2.1"/>
michael@0 140 <menuitem label="SubSubFile2" id="mi_file1.2.2"/>
michael@0 141 <menuitem label="SubSubFile3" id="mi_file1.2.3"/>
michael@0 142 <menuitem label="SubSubFile4" id="mi_file1.2.4"/>
michael@0 143 </menupopup>
michael@0 144 </menu>
michael@0 145 </menupopup>
michael@0 146 </menu>
michael@0 147 </menubar>
michael@0 148 </vbox>
michael@0 149 </hbox>
michael@0 150
michael@0 151 </window>
michael@0 152

mercurial