4 <script src=
"../resources/js-test.js"></script>
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">ARIA 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>
29 <div id=
"console"></div>
31 description("This tests which elements expose themselves as readonly. Readonly here refers to whether the item is not editable, not whether a control value can be changed vs if it's unavailable.");
33 if (window
.testRunner
&& window
.accessibilityController
) {
34 window
.testRunner
.dumpAsText();
36 function check(id
, expected_readonly
) {
38 window
.element
= document
.getElementById(id
);
40 shouldBe("document.activeElement == element", "true");
41 window
.axElement
= accessibilityController
.focusedElement
;
43 shouldBe("axElement.isReadOnly", "" + expected_readonly
);
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);