test_txtctrl.html (3995B)
1 <!DOCTYPE html> 2 <html> 3 4 <head> 5 <title>HTML text controls tests</title> 6 <link rel="stylesheet" type="text/css" 7 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 8 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 10 11 <script type="application/javascript" 12 src="../common.js"></script> 13 <script type="application/javascript" 14 src="../role.js"></script> 15 16 <script type="application/javascript"> 17 function doTest() { 18 // editable div 19 var accTree = { 20 role: ROLE_SECTION, 21 children: [ 22 { // text child 23 role: ROLE_TEXT_LEAF, 24 children: [], 25 }, 26 ], 27 }; 28 29 testAccessibleTree("txc1", accTree); 30 31 // input@type="text", value 32 accTree = { 33 role: ROLE_ENTRY, 34 children: [ 35 { // text child 36 role: ROLE_TEXT_LEAF, 37 children: [], 38 }, 39 ], 40 }; 41 42 testAccessibleTree("txc2", accTree); 43 44 // input@type="text", no value 45 accTree = 46 { ENTRY: [ ] }; 47 48 testAccessibleTree("txc3", accTree); 49 50 // textarea 51 accTree = { 52 role: ROLE_ENTRY, 53 children: [ 54 { 55 role: ROLE_TEXT_LEAF, // hello1\nhello2 text 56 }, 57 ], 58 }; 59 60 testAccessibleTree("txc4", accTree); 61 62 // input@type="password" 63 accTree = { 64 role: ROLE_PASSWORD_TEXT, 65 children: [ 66 { 67 role: ROLE_TEXT_LEAF, 68 children: [], 69 }, 70 ], 71 }; 72 73 testAccessibleTree("txc5", accTree); 74 75 // input@type="tel", value 76 accTree = { 77 role: ROLE_ENTRY, 78 children: [ 79 { // text child 80 role: ROLE_TEXT_LEAF, 81 children: [], 82 }, 83 ], 84 }; 85 86 testAccessibleTree("txc6", accTree); 87 88 // input@type="email", value 89 accTree = { 90 role: ROLE_EDITCOMBOBOX, // Because of list attribute 91 children: [ 92 { // text child 93 role: ROLE_TEXT_LEAF, 94 children: [], 95 }, 96 ], 97 }; 98 99 testAccessibleTree("txc7", accTree); 100 101 // input@type="search", value 102 accTree = { 103 role: ROLE_EDITCOMBOBOX, // Because of list attribute 104 children: [ 105 { // text child 106 role: ROLE_TEXT_LEAF, 107 children: [], 108 }, 109 ], 110 }; 111 112 testAccessibleTree("txc8", accTree); 113 114 SimpleTest.finish(); 115 } 116 117 SimpleTest.waitForExplicitFinish(); 118 addA11yLoadEvent(doTest); 119 </script> 120 </head> 121 <body> 122 123 <a target="_blank" 124 title="overflowed content doesn't expose child text accessibles" 125 href="https://bugzilla.mozilla.org/show_bug.cgi?id=489306"> 126 Mozilla Bug 489306 127 </a><br> 128 <a target="_blank" 129 href="https://bugzilla.mozilla.org/show_bug.cgi?id=542824" 130 title="Create child accessibles for text controls from native anonymous content"> 131 Mozilla Bug 542824 132 </a> 133 <a target="_blank" 134 href="https://bugzilla.mozilla.org/show_bug.cgi?id=625652" 135 title="Make sure accessible tree is correct when rendered text is changed"> 136 Mozilla Bug 625652 137 </a> 138 139 <p id="display"></p> 140 <div id="content" style="display: none"></div> 141 <pre id="test"> 142 </pre> 143 144 <div id="txc1" contentEditable="true"> 145 1hellohello 146 </div> 147 <input id="txc2" value="hello"> 148 <input id="txc3"> 149 <textarea id="txc4"> 150 hello1 151 hello2 152 </textarea> 153 <input id="txc5" type="password" value="hello"> 154 <input id="txc6" type="tel" value="4167771234"> 155 156 Email Address: 157 <input id="txc7" type="email" list="contacts" value="xyzzy"> 158 <datalist id="contacts"> 159 <option>xyzzy@plughs.com</option> 160 <option>nobody@mozilla.org</option> 161 </datalist> 162 163 </br>Search for: 164 <input id="txc8" type="search" list="searchhisty" value="Gamma"> 165 <datalist id="searchhisty"> 166 <option>Gamma Rays</option> 167 <option>Gamma Ray Bursts</option> 168 </datalist> 169 170 </body> 171 </html>