OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../resources/js-test.js"></script> | 2 <script src="../resources/js-test.js"></script> |
3 | 3 |
4 <!-- Richly editable elements. --> | 4 <!-- Richly editable elements. --> |
5 <div id="richly_editable1" contentEditable></div> | 5 <div id="richly_editable1" contentEditable></div> |
6 <div id="richly_editable2" contentEditable="true"></div> | 6 <div id="richly_editable2" contentEditable="true"></div> |
7 <div contentEditable> | 7 <div contentEditable> |
8 <p id="richly_editable3">Some text.</p> | 8 <p id="richly_editable3">Some text.</p> |
9 </div> | 9 </div> |
10 <div contentEditable="true"> | 10 <div contentEditable="true"> |
11 <p id="richly_editable4">Some text.</p> | 11 <p id="richly_editable4">Some text.</p> |
12 </div> | 12 </div> |
13 <div style="display: none;" aria-hidden="false"> | 13 <div style="display: none;" aria-hidden="false"> |
14 <p id="richly_editable5" contentEditable>Some text.</p> | 14 <p id="richly_editable5" contentEditable>Some text.</p> |
15 </div> | 15 </div> |
16 <canvas id="empty_canvas" width="200" height="100" | 16 <canvas id="empty_canvas" width="200" height="100" |
17 style="border: 1px solid #000000;"> | 17 style="border: 1px solid #000000;"> |
18 <div id="richly_editable6" contentEditable="true">Some text.</div> | 18 <div id="richly_editable6" contentEditable="true">Some text.</div> |
19 </canvas> | 19 </canvas> |
| 20 <div id="richly_editable7" contentEditable role="textbox">Some text.</div> |
20 | 21 |
21 <!-- Non-richly editable elements. --> | 22 <!-- Non-richly editable elements. --> |
22 <input id="non_richly_editable1" type="text" value="Some text."> | 23 <input id="non_richly_editable1" type="text" value="Some text."> |
23 <textarea id="non_richly_editable2"> | 24 <textarea id="non_richly_editable2"> |
24 Some text.</textarea> | 25 Some text.</textarea> |
25 <div id="non_richly_editable3" contentEditable="plaintext-only"></div> | 26 <div id="non_richly_editable3" contentEditable="plaintext-only"></div> |
26 <div id="non_richly_editable4" contentEditable style="-webkit-user-modify: read-
only;"></div> | 27 <div id="non_richly_editable4" contentEditable style="-webkit-user-modify: read-
only;"></div> |
27 <div contentEditable="plaintext-only"> | 28 <div contentEditable="plaintext-only"> |
28 <p id="non_richly_editable5">Some text.</p> | 29 <p id="non_richly_editable5">Some text.</p> |
29 </div> | 30 </div> |
30 <div id="non_richly_editable6" contentEditable role="textbox">Some text.</div> | 31 <p id="non_richly_editable6" tabindex="0">Some text.</p> |
31 <p id="non_richly_editable7" tabindex="0">Some text.</p> | 32 <button id="non_richly_editable7">Button</button> |
32 <button id="non_richly_editable8">Button</button> | |
33 | 33 |
34 <script> | 34 <script> |
35 description("This tests that only elements that allow the user to edit rich
text in them are recognized as being richly editable."); | 35 description("This tests that only elements that allow the user to edit rich
text in them are recognized as being richly editable."); |
36 | 36 |
37 if (window.accessibilityController) { | 37 if (window.accessibilityController) { |
38 | 38 |
39 for (var i = 1; i <= 6; ++i) { | 39 for (var i = 1; i <= 7; ++i) { |
40 var elementId = "richly_editable" + i; | 40 var elementId = "richly_editable" + i; |
41 var element = document.getElementById(elementId); | 41 var element = document.getElementById(elementId); |
42 element.focus(); | 42 element.focus(); |
43 var axElement = accessibilityController.focusedElement; | 43 var axElement = accessibilityController.focusedElement; |
44 shouldBeTrue("axElement.isRichlyEditable"); | 44 shouldBeTrue("axElement.isRichlyEditable"); |
45 } | 45 } |
46 | 46 |
47 for (var i = 1; i <= 7; ++i) { | 47 for (var i = 1; i <= 7; ++i) { |
48 var elementId = "non_richly_editable" + i; | 48 var elementId = "non_richly_editable" + i; |
49 var element = document.getElementById(elementId); | 49 var element = document.getElementById(elementId); |
50 element.focus(); | 50 element.focus(); |
51 var axElement = accessibilityController.focusedElement; | 51 var axElement = accessibilityController.focusedElement; |
52 shouldBeFalse("axElement.isRichlyEditable"); | 52 shouldBeFalse("axElement.isRichlyEditable"); |
53 } | 53 } |
54 } | 54 } |
55 </script> | 55 </script> |
OLD | NEW |