4 <script src=
"../resources/js-test-pre.js"></script>
7 <input id=
"text1" type=
"text" value=
"Value">
8 <input id=
"checkbox1" type=
"checkbox" checked
>
9 <input id=
"number1" type=
"number" value=
"123">
10 <input id=
"radio1" type=
"radio" checked
>
11 <input id=
"slider1" type=
"range" min=
"1" max=
"10" value=
"5">
12 <input id=
"submit1" type=
"submit">
13 <select id=
"combobox1"><option>1<option selected
>2</select>
14 <select multiple
id=
"listbox1"><option>1<option selected
>2</select>
15 <textarea id=
"textarea1">Textarea
</textarea>
19 <input id=
"text2" type=
"text" value=
"Value">
20 <input id=
"checkbox2" type=
"checkbox" checked
>
21 <input id=
"number2" type=
"number" value=
"123">
22 <input id=
"radio2" type=
"radio" checked
>
23 <input id=
"slider2" type=
"range" min=
"1" max=
"10" value=
"5">
24 <input id=
"submit2" type=
"submit">
25 <select id=
"combobox2"><option>1<option selected
>2</select>
26 <select multiple
id=
"listbox2"><option>1<option selected
>2</select>
27 <textarea id=
"textarea2">Textarea
</textarea>
30 <div id=
"console"></div>
32 description("This tests whether AXValue is writable for various form controls.");
34 if (window
.testRunner
&& window
.accessibilityController
) {
35 window
.testRunner
.dumpAsText();
37 function check(id1
, id2
, expected1
) {
39 window
.element1
= document
.getElementById(id1
);
41 shouldBe("document.activeElement == element1", "true");
42 window
.axElement1
= accessibilityController
.focusedElement
;
45 window
.element2
= document
.getElementById(id2
);
47 shouldBe("document.activeElement == element2", "true");
48 window
.axElement2
= accessibilityController
.focusedElement
;
50 shouldBe("axElement1.isAttributeSettable('AXValue')", String(expected1
));
51 // If contentEditable, AXValue is always writable.
52 shouldBe("axElement2.isAttributeSettable('AXValue')", "true");
56 // All text-like form controls should have a writable AXValue.
57 check("text1", "text2", true);
58 check("number1", "number2", true);
59 check("textarea1", "textarea2", true);
61 // A slider can set AXValue.
62 check("slider1", "slider2", true);
64 // Other controls whose contents or state can be user modified should have a read-only
65 // AXValue for non-ATK-based platforms, unless those controls are inside contentEditable,
66 // then everything should have a writable AXValue.
67 isATK
= accessibilityController
.platformName
== "atk";
68 check("checkbox1", "checkbox2", isATK
? true : false);
69 check("radio1", "radio2", isATK
? true : false);
70 check("submit1", "submit2", false);
71 check("combobox1", "combobox2", isATK
? true : false);
72 check("listbox1", "listbox2", isATK
? true : false);
77 <script src=
"../resources/js-test-post.js"></script>