blob: e26526a0b3ce0f24847d977fb7613f51d4e445cd [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<body>
<script src="../resources/js-test.js"></script>
<div id="container">
<button id="button"></button>
<input id="text" type="text">
<input id="checkbox" type="checkbox">
<input id="radio" type="radio">
<input id="submit" type="submit">
<input id="slider" type="range">
<select id="combobox"><option>1<option>2</select>
<select id="listbox" multiple><option>1<option>2</select>
<textarea id="textarea"></textarea>
</div>
<div id="console"></div>
<script>
description("This test makes sure that disabled form controls are not exposed as focusable.");
if (window.testRunner && window.accessibilityController) {
window.testRunner.dumpAsText();
function checkControl(id) {
window.element = document.getElementById(id);
debug(element.id);
element.focus();
window.axElement = accessibilityController.focusedElement;
shouldBeTrue("axElement.isFocusable");
element.disabled = true;
shouldBeFalse("axElement.isFocusable");
}
checkControl("button");
checkControl("text");
checkControl("checkbox");
checkControl("radio");
checkControl("submit");
checkControl("slider");
checkControl("combobox");
checkControl("listbox");
checkControl("textarea");
document.querySelector("#container").remove();
}
</script>
</body>
</html>