test_combobox.xhtml (2913B)
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 xmlns:html="http://www.w3.org/1999/xhtml" 8 title="Accessible XUL menulist and textbox @autocomplete hierarchy tests"> 9 10 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 11 12 <script type="application/javascript" 13 src="../common.js" /> 14 <script type="application/javascript" 15 src="../role.js" /> 16 17 <script type="application/javascript"> 18 <![CDATA[ 19 //////////////////////////////////////////////////////////////////////////// 20 // Test 21 22 function doTest() 23 { 24 ////////////////////////////////////////////////////////////////////////// 25 // menulist 26 27 var accTree = { 28 role: ROLE_COMBOBOX, 29 children: [ 30 { 31 role: ROLE_COMBOBOX_LIST, 32 children: [ 33 { 34 role: ROLE_COMBOBOX_OPTION, 35 children: [] 36 }, 37 { 38 role: ROLE_COMBOBOX_OPTION, 39 children: [] 40 } 41 ] 42 } 43 ] 44 }; 45 46 testAccessibleTree("menulist", accTree); 47 48 ////////////////////////////////////////////////////////////////////////// 49 // textbox@type=autocomplete #1 (history) 50 51 accTree = { 52 // html:input 53 role: ROLE_ENTRY, 54 children: [ 55 { 56 // #text 57 role: ROLE_TEXT_LEAF, 58 name: "http://mochi.test:8888/redirect-a11y.html", 59 children: [] 60 } 61 ], 62 }; 63 64 testAccessibleTree("autocomplete", accTree); 65 66 SimpleTest.finish() 67 } 68 69 SimpleTest.waitForExplicitFinish(); 70 addA11yLoadEvent(doTest); 71 ]]> 72 </script> 73 74 <hbox flex="1" style="overflow: auto;"> 75 <body xmlns="http://www.w3.org/1999/xhtml"> 76 <a target="_blank" 77 href="https://bugzilla.mozilla.org/show_bug.cgi?id=249292" 78 title="Ensure accessible children for toolbarbutton types 'menu'"> 79 Mozilla Bug 249292 80 </a> 81 <a target="_blank" 82 href="https://bugzilla.mozilla.org/show_bug.cgi?id=626660" 83 title="Cache rendered text on a11y side"> 84 Mozilla Bug 626660 85 </a><br/> 86 <p id="display"></p> 87 <div id="content" style="display: none"> 88 </div> 89 <pre id="test"> 90 </pre> 91 </body> 92 93 <vbox flex="1"> 94 <menulist id="menulist"> 95 <menupopup> 96 <menuitem label="item"/> 97 <menuitem label="item"/> 98 </menupopup> 99 </menulist> 100 101 <html:input is="autocomplete-input" 102 id="autocomplete" 103 value="http://mochi.test:8888/redirect-a11y.html"/> 104 </vbox> 105 </hbox> 106 107 </window>