test_tree.xhtml (5483B)
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" 4 type="text/css"?> 5 6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 7 title="Accessibility Name Calculating Test."> 8 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 10 11 <script type="application/javascript" 12 src="../treeview.js" /> 13 14 <script type="application/javascript" 15 src="../common.js"></script> 16 <script type="application/javascript" 17 src="../role.js"></script> 18 <script type="application/javascript" 19 src="../name.js"></script> 20 <script type="application/javascript" 21 src="../events.js"></script> 22 23 <script type="application/javascript"> 24 <![CDATA[ 25 function treeTester(aID) 26 { 27 this.DOMNode = getNode(aID); 28 29 this.invoke = function treeTester_invoke() 30 { 31 this.DOMNode.view = new nsTreeTreeView(); 32 } 33 34 this.check = function treeTester_check() 35 { 36 var tree = { 37 role: ROLE_OUTLINE, 38 children: [ 39 { 40 role: ROLE_LIST 41 }, 42 { 43 role: ROLE_OUTLINEITEM, 44 children: [], 45 name: "row1col" 46 }, 47 { 48 role: ROLE_OUTLINEITEM, 49 children: [], 50 name: "row2_col" 51 }, 52 { 53 role: ROLE_OUTLINEITEM, 54 children: [], 55 name: "row2.1_col" 56 }, 57 { 58 role: ROLE_OUTLINEITEM, 59 children: [], 60 name: "row2.2_col" 61 }, 62 { 63 role: ROLE_OUTLINEITEM, 64 children: [], 65 name: "row3_col" 66 }, 67 { 68 role: ROLE_OUTLINEITEM, 69 children: [], 70 name: "row4col" 71 } 72 ] 73 }; 74 testAccessibleTree(this.DOMNode, tree); 75 } 76 77 this.getID = function treeTester_getID() 78 { 79 return "Tree name testing for " + aID; 80 } 81 } 82 83 function tableTester(aID, aIsTable, aCol1ID, aCol2ID) 84 { 85 this.DOMNode = getNode(aID); 86 87 this.invoke = function tableTester_invoke() 88 { 89 this.DOMNode.view = new nsTableTreeView(2); 90 } 91 92 this.check = function tableTester_check() 93 { 94 var tree = { 95 role: aIsTable ? ROLE_TABLE : ROLE_TREE_TABLE, 96 children: [ 97 { 98 role: ROLE_LIST 99 }, 100 { 101 role: ROLE_ROW, 102 children: [ 103 { 104 role: ROLE_GRID_CELL, 105 children: [], 106 name: "row0_" + aCol1ID 107 }, 108 { 109 role: ROLE_GRID_CELL, 110 children: [], 111 name: "row0_" + aCol2ID 112 } 113 ], 114 name: "row0_" + aCol1ID + " row0_" + aCol2ID 115 }, 116 { 117 role: ROLE_ROW, 118 children: [ 119 { 120 role: ROLE_GRID_CELL, 121 children: [], 122 name: "row1_" + aCol1ID 123 }, 124 { 125 role: ROLE_GRID_CELL, 126 children: [], 127 name: "row1_" + aCol2ID 128 } 129 ], 130 name: "row1_" + aCol1ID + " row1_" + aCol2ID 131 } 132 ] 133 }; 134 testAccessibleTree(this.DOMNode, tree); 135 } 136 137 this.getID = function tableTester_getID() 138 { 139 return "Tree name testing for " + aID; 140 } 141 } 142 143 var gQueue = null; 144 function doTest() 145 { 146 gQueue = new eventQueue(EVENT_REORDER); 147 148 gQueue.push(new treeTester("tree")); 149 gQueue.push(new tableTester("table", true, "t_col1", "t_col2")); 150 gQueue.push(new tableTester("treetable", false, "tt_col1", "tt_col2")); 151 152 gQueue.invoke(); // Will call SimpleTest.finish() 153 } 154 155 SimpleTest.waitForExplicitFinish(); 156 addA11yLoadEvent(doTest); 157 ]]> 158 </script> 159 160 <hbox flex="1" style="overflow: auto;"> 161 162 <body xmlns="http://www.w3.org/1999/xhtml"> 163 <a target="_blank" 164 href="https://bugzilla.mozilla.org/show_bug.cgi?id=546812" 165 title="Treegrid row accessible shouldn't inherit name from tree accessible"> 166 Mozilla Bug 546812 167 </a> 168 <a target="_blank" 169 href="https://bugzilla.mozilla.org/show_bug.cgi?id=664376" 170 title="Table rows of XUL trees no longer containing cell content as accessible name"> 171 Mozilla Bug 664376 172 </a> 173 <p id="display"></p> 174 <div id="content" style="display: none"> 175 </div> 176 <pre id="test"> 177 </pre> 178 </body> 179 180 <vbox flex="1"> 181 182 <tree id="tree" flex="1"> 183 <treecols> 184 <treecol id="col" flex="1" primary="true" label="column"/> 185 </treecols> 186 <treechildren/> 187 </tree> 188 189 <tree id="table" flex="1"> 190 <treecols> 191 <treecol id="t_col1" flex="1" label="column"/> 192 <treecol id="t_col2" flex="1" label="column 2"/> 193 </treecols> 194 <treechildren/> 195 </tree> 196 197 <tree id="treetable" flex="1"> 198 <treecols> 199 <treecol id="tt_col1" flex="1" label="column" primary="true"/> 200 <treecol id="tt_col2" flex="1" label="column 2"/> 201 </treecols> 202 <treechildren/> 203 </tree> 204 205 </vbox> <!-- close tests area --> 206 </hbox> <!-- close main area --> 207 </window>