| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE HTML> | |
| 2 <html> | |
| 3 <body> | |
| 4 <script src="../../../fast/js/resources/js-test-pre.js"></script> | |
| 5 | |
| 6 <div> | |
| 7 <a id="link1" href="#">Link</a> | |
| 8 <button id="button1">Button</button> | |
| 9 <input id="text1" type="text" value="Value"> | |
| 10 <input id="checkbox1" type="checkbox" checked> | |
| 11 <input id="number1" type="number" value="123"> | |
| 12 <input id="radio1" type="radio" checked> | |
| 13 <input id="slider1" type="range" min="1" max="10" value="5"> | |
| 14 <input id="submit1" type="submit"> | |
| 15 <select id="combobox1"><option>1<option selected>2</select> | |
| 16 <select multiple id="listbox1"><option>1<option selected>2</select> | |
| 17 <textarea id="textarea1">Textarea</textarea> | |
| 18 <div id="focusable1" tabindex="0">Focusable</div> | |
| 19 <h5 id="heading1" tabindex="0">Heading</h5> | |
| 20 <div id="aria-button1" tabindex="0" role="button">ARIA button</div> | |
| 21 <div id="aria-togglebutton1" tabindex="0" role="button" aria-pressed="false">A
RIA toggle button</div> | |
| 22 <div id="aria-link1" tabindex="0" role="link">ARIA link</div> | |
| 23 <div id="contenteditable_root1" contentEditable> | |
| 24 <button id="contenteditable_button1">Button</button> | |
| 25 </div> | |
| 26 | |
| 27 </div> | |
| 28 | |
| 29 <div id="console"></div> | |
| 30 <script> | |
| 31 description("This tests which elements expose themselves as readonly. Readonly h
ere refers to whether the item is not editable, not whether a control value can
be changed vs if it's unavailable."); | |
| 32 | |
| 33 if (window.testRunner && window.accessibilityController) { | |
| 34 window.testRunner.dumpAsText(); | |
| 35 | |
| 36 function check(id, expected_readonly) { | |
| 37 debug(id); | |
| 38 window.element = document.getElementById(id); | |
| 39 element.focus(); | |
| 40 shouldBe("document.activeElement == element", "true"); | |
| 41 window.axElement = accessibilityController.focusedElement; | |
| 42 | |
| 43 shouldBe("axElement.isReadOnly", "" + expected_readonly); | |
| 44 debug(""); | |
| 45 } | |
| 46 | |
| 47 check("link1", true); | |
| 48 check("button1", true); | |
| 49 check("text1", false); | |
| 50 check("checkbox1", true); | |
| 51 check("number1", false); | |
| 52 check("radio1", true); | |
| 53 check("slider1", true); | |
| 54 check("submit1", true); | |
| 55 check("combobox1", true); | |
| 56 check("listbox1", true); | |
| 57 check("textarea1", false); | |
| 58 check("focusable1", true); | |
| 59 check("heading1", true); | |
| 60 check("aria-button1", true); | |
| 61 check("aria-togglebutton1", true); | |
| 62 check("aria-link1", true); | |
| 63 check("contenteditable_root1", false); | |
| 64 check("contenteditable_button1", false); | |
| 65 } | |
| 66 | |
| 67 </script> | |
| 68 | |
| 69 <script src="../../../fast/js/resources/js-test-post.js"></script> | |
| 70 </body> | |
| 71 </html> | |
| OLD | NEW |