blob: c2a0dd3811c97dded2dd2e59f7b4985ebd30e420 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<script src="../resources/accessibility-helper.js"></script>
</head>
<body id="body">
<div id="content">
<span id="labelShutdown"><label id="labelElement" for="shutdownTime">Shut down computer after</label></span>
<input id="shutdownTime" type="text" value="10" aria-labelledby="labelShutdown shutdownTime shutdownUnit" />
<span id="shutdownUnit">minutes</span>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that if aria-labelledby is used, then label elements are not used");
if (window.accessibilityController) {
var text = document.getElementById("shutdownTime");
text.focus();
text = accessibilityController.focusedElement;
shouldBeEqualToString("platformValueForW3CName(text)", "Shut down computer after 10 minutes");
// There should be no title UI element.
shouldBe("text.titleUIElement() != null && text.titleUIElement().isValid", "false");
var labelElement = accessibilityController.accessibleElementById("labelElement");
// This just makes sure that the label element is still visible in the AX hierarchy, even though
// it's a label element (sometimes they are ignored).
debug("Label element role is: " + labelElement.role);
document.getElementById("content").style.visibility = "hidden";
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>