test_general.html (7062B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>test nsHyperTextAccessible accesible objects creation and their roles</title> 5 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 6 7 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 8 9 <script type="application/javascript" 10 src="../common.js"></script> 11 <script type="application/javascript" 12 src="../role.js"></script> 13 <script type="application/javascript" 14 src="../attributes.js"></script> 15 16 <script type="application/javascript"> 17 function doTests() { 18 // landmark tests section 19 testRole("frm", ROLE_FORM); 20 21 // nsHyperTextAcc tests section 22 // Test html:form. 23 testRole("nav", ROLE_LANDMARK); 24 testRole("header", ROLE_LANDMARK); 25 testRole("footer", ROLE_LANDMARK); 26 testRole("article", ROLE_ARTICLE); 27 testRole("aside", ROLE_LANDMARK); 28 testRole("section", ROLE_SECTION); 29 30 // Bug 996821 31 // Check that landmark elements get accessibles with styled overflow. 32 testRole("section_overflow", ROLE_SECTION); 33 testRole("nav_overflow", ROLE_LANDMARK); 34 testRole("header_overflow", ROLE_SECTION); 35 testRole("aside_overflow", ROLE_LANDMARK); 36 testRole("footer_overflow", ROLE_SECTION); 37 testRole("article_overflow", ROLE_ARTICLE); 38 39 // test html:div 40 testRole("sec", ROLE_SECTION); 41 42 // Test html:blockquote 43 testRole("quote", ROLE_BLOCKQUOTE); 44 45 // Test html:h, all levels 46 testRole("head1", ROLE_HEADING); 47 testRole("head2", ROLE_HEADING); 48 testRole("head3", ROLE_HEADING); 49 testRole("head4", ROLE_HEADING); 50 testRole("head5", ROLE_HEADING); 51 testRole("head6", ROLE_HEADING); 52 53 // Test that an html:input @type="file" is exposed as ROLE_PUSHBUTTON. 54 testRole("data", ROLE_PUSHBUTTON); 55 56 // Test that input type="checkbox" and type="radio" are 57 // exposed as such regardless of appearance style. 58 testRole("checkbox_regular", ROLE_CHECKBUTTON); 59 testRole("checkbox_appearance_none", ROLE_CHECKBUTTON); 60 testRole("radio_regular", ROLE_RADIOBUTTON); 61 testRole("radio_appearance_none", ROLE_RADIOBUTTON); 62 63 // Test regular paragraph by comparison to make sure exposure does not 64 // get broken. 65 testRole("p", ROLE_PARAGRAPH); 66 67 // Test dl, dt, dd 68 testRole("definitionlist", ROLE_DEFINITION_LIST); 69 testRole("definitionterm", ROLE_TERM); 70 testRole("definitiondescription", ROLE_DEFINITION); 71 72 // Has click, mousedown or mouseup listeners. 73 testRole("span1", ROLE_TEXT); 74 testRole("span2", ROLE_TEXT); 75 testRole("span3", ROLE_TEXT); 76 77 // Test role of listbox inside combobox 78 testRole("listbox1", ROLE_COMBOBOX_LIST); 79 testRole("listbox2", ROLE_COMBOBOX_LIST); 80 81 // Test role of menu and li items in menu 82 testRole("menu", ROLE_LIST); 83 testRole("menuItem", ROLE_LISTITEM); 84 85 SimpleTest.finish(); 86 } 87 88 SimpleTest.waitForExplicitFinish(); 89 addA11yLoadEvent(doTests); 90 </script> 91 </head> 92 <body> 93 94 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=472326" 95 title="html:input of type "file" no longer rendered to screen readers"> 96 Mozilla Bug 472326 97 </a><br> 98 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=474261" 99 title="Test remaining implementations in nsHyperTextAccessible::GetRole"> 100 bug 474261 101 </a><br> 102 <a target="_blank" 103 href="https://bugzilla.mozilla.org/show_bug.cgi?id=423409" 104 title="Expose click action if mouseup and mousedown are registered"> 105 Mozilla Bug 423409 106 </a> 107 <a target="_blank" 108 title="Provide mappings for html5 <nav> <header> <footer> <article>" 109 href="https://bugzilla.mozilla.org/show_bug.cgi?id=593368"> 110 Bug 593368 111 </a><br/> 112 <a target="_blank" 113 href="https://bugzilla.mozilla.org/show_bug.cgi?id=613502" 114 title="Map <article> like we do aria role article"> 115 Bug 613502 116 </a> 117 <a target="_blank" 118 href="https://bugzilla.mozilla.org/show_bug.cgi?id=610650" 119 title="Change implementation of HTML5 landmark elements to conform"> 120 Bug 610650 121 </a> 122 <a target="_blank" 123 href="https://bugzilla.mozilla.org/show_bug.cgi?id=614310" 124 title="Map section to pane (like role=region)"> 125 Mozilla Bug 614310 126 </a> 127 <a target="_blank" 128 href="https://bugzilla.mozilla.org/show_bug.cgi?id=734982" 129 title="Map ARIA role FORM"> 130 Bug 734982 131 </a> 132 <a target="_blank" 133 href="https://bugzilla.mozilla.org/show_bug.cgi?id=1044431" 134 title="Listbox owned by combobox has the wrong role"> 135 Mozilla Bug 1044431 136 </a> 137 138 <p id="display"></p> 139 <div id="content" style="display: none"></div> 140 <pre id="test"> 141 </pre> 142 143 <form id="frm" action="submit.php" method="post"> 144 <label for="data">File</label>: 145 <input type="file" id="data" name="data" size="50"/> 146 <input type="checkbox" id="checkbox_regular" value="Check me"/> 147 <input type="checkbox" style="-moz-appearance: none;" id="checkbox_appearance_none" value="Check me"/> 148 <input type="radio" id="radio_regular" value="Check me"/> 149 <input type="radio" style="-moz-appearance: none;" id="radio_appearance_none" value="Check me"/> 150 </form> 151 152 <nav id="nav">a nav</nav> 153 <header id="header">a header</header> 154 <footer id="footer">a footer</footer> 155 <article id="article">an article</article> 156 <aside id="aside">by the way I am an aside</aside> 157 <section id="section">a section</section> 158 159 <section style="overflow: hidden;" id="section_overflow"> 160 <nav style="overflow: hidden;" 161 id="nav_overflow">overflow nav</nav> 162 <header style="overflow: hidden;" 163 id="header_overflow">overflow header</header> 164 <aside style="overflow: hidden;" aria-label="aside" 165 id="aside_overflow">overflow aside</aside> 166 <footer style="overflow: hidden;" 167 id="footer_overflow">overflow footer</footer> 168 </section> 169 <article style="overflow: hidden;" 170 id="article_overflow">overflow article</article> 171 172 <p id="p">A paragraph for comparison.</p> 173 <div id="sec">A normal div</div> 174 <blockquote id="quote">A citation</blockquote> 175 <h1 id="head1">A heading level 1</h1> 176 <h2 id="head2">A heading level 2</h2> 177 <h3 id="head3">A heading level 3</h3> 178 <h4 id="head4">A heading level 4</h4> 179 <h5 id="head5">A heading level 5</h5> 180 <h6 id="head6">A heading level 6</h6> 181 182 <dl id="definitionlist"> 183 <dt id="definitionterm">gecko</dt> 184 <dd id="definitiondescription">geckos have sticky toes</dd> 185 </dl> 186 187 <span id="span1" onclick="">clickable span</span> 188 <span id="span2" onmousedown="">clickable span</span> 189 <span id="span3" onmouseup="">clickable span</span> 190 191 <div id="combobox1" role="combobox"> 192 <div id="listbox1" role="listbox"></div> 193 </div> 194 <div id="combobox2" role="combobox" aria-owns="listbox2"></div> 195 <div id="listbox2" role="listbox"></div> 196 197 <menu id="menu"> 198 <li id="menuItem">menu item!</li> 199 </menu> 200 </body> 201 </html>