test_ariadialog.html (2960B)
1 <!DOCTYPE html> 2 <html> 3 4 <head> 5 <title>Table creation in ARIA dialog test</title> 6 7 <link rel="stylesheet" type="text/css" 8 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 9 10 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 11 12 <script type="application/javascript" 13 src="../common.js"></script> 14 <script type="application/javascript" 15 src="../role.js"></script> 16 <script type="application/javascript" 17 src="../events.js"></script> 18 19 <script type="application/javascript"> 20 21 // ////////////////////////////////////////////////////////////////////////// 22 // Invokers 23 24 function showARIADialog(aID) { 25 this.node = getNode(aID); 26 27 this.eventSeq = [ 28 new invokerChecker(EVENT_SHOW, this.node), 29 ]; 30 31 this.invoke = function showARIADialog_invoke() { 32 getNode("dialog").style.display = "block"; 33 getNode("table").style.visibility = "visible"; 34 getNode("a").textContent = "link"; 35 getNode("input").value = "hello"; 36 getNode("input").focus(); 37 }; 38 39 this.finalCheck = function showARIADialog_finalCheck() { 40 var tree = { 41 role: ROLE_DIALOG, 42 children: [ 43 { 44 role: ROLE_PUSHBUTTON, 45 children: [ { role: ROLE_TEXT_LEAF } ], 46 }, 47 { 48 role: ROLE_ENTRY, 49 }, 50 ], 51 }; 52 testAccessibleTree(aID, tree); 53 }; 54 55 this.getID = function showARIADialog_getID() { 56 return "show ARIA dialog"; 57 }; 58 } 59 60 // ////////////////////////////////////////////////////////////////////////// 61 // Test 62 63 // gA11yEventDumpID = "eventdump"; // debug stuff 64 // gA11yEventDumpToConsole = true; 65 66 var gQueue = null; 67 68 function doTest() { 69 // enableLogging("tree"); 70 gQueue = new eventQueue(); 71 72 // make the accessible an inaccessible 73 gQueue.push(new showARIADialog("dialog")); 74 75 gQueue.invoke(); // SimpleTest.finish() will be called in the end 76 } 77 78 SimpleTest.waitForExplicitFinish(); 79 addA11yLoadEvent(doTest); 80 </script> 81 </head> 82 <body> 83 84 <a target="_blank" 85 title="Rework accessible tree update code" 86 href="https://bugzilla.mozilla.org/show_bug.cgi?id=570275"> 87 Mozilla Bug 570275 88 </a> 89 90 <p id="display"></p> 91 <div id="content" style="display: none"></div> 92 <pre id="test"> 93 </pre> 94 95 <div id="dialog" role="dialog" style="display: none;"> 96 <table id="table" role="presentation" 97 style="display: block; position: absolute; top: 88px; left: 312.5px; z-index: 10010; visibility: hidden;"> 98 <tbody> 99 <tr> 100 <td role="presentation"> 101 <div role="presentation"> 102 <a id="a" role="button">text</a> 103 </div> 104 <input id="input"> 105 </td> 106 </tr> 107 </tbody> 108 </table> 109 </div> 110 111 <div id="eventdump"></div> 112 </body> 113 </html>