blob: 7d7544452ea11e627b8887292a64f805f4b231ac [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<title>Fieldset Element</title>
</head>
<body>
<form>
<!-- fieldset with aria-label. -->
<fieldset aria-label="High Score:" class="fieldsetTest" id="f0">
Name: <input type="text">
</fieldset>
</form>
<form>
<!-- fieldset and legend. -->
<fieldset class="fieldsetTest" id="f1">
<legend>High Score:</legend>
Name: <input type="text">
</fieldset>
</form>
<form>
<!-- fieldset with aria-label and legend. -->
<fieldset aria-label="New High Score:" class="fieldsetTest" id="f2">
<legend>High Score:</legend>
Name: <input type="text">
</fieldset>
</form>
<form>
<!-- fieldset and legend with aria-label. -->
<fieldset class="fieldsetTest" id="f3">
<legend aria-label="New High Score:">High Score:</legend>
Name: <input type="text">
</fieldset>
</form>
<form>
<!-- fieldset and hidden legend. -->
<fieldset class="fieldsetTest" id="f4">
<legend aria-hidden="true">High Score:</legend>
Name: <input type="text">
</fieldset>
</form>
<form>
<!-- fieldset and offscreen legend. -->
<fieldset class="fieldsetTest" id="f5">
<legend style="left:-9999px; position:absolute;">High Score:</legend>
Name: <input type="text">
</fieldset>
</form>
<form>
<!-- fieldset and unrendered legend. -->
<fieldset class="fieldsetTest" id="f6">
<legend style="display:none;">High Score:</legend>
Name: <input type="text">
</fieldset>
</form>
<!-- legend outside fieldset. -->
<legend id="l0">Other:</legend>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that fieldset and legend elements are exposed correctly.");
if (window.accessibilityController) {
var fieldsetDescription = 0;
var fieldsetTestCount = 0;
var legendValue = 0;
// fieldset tests.
fieldsetTestCount = document.getElementsByClassName("fieldsetTest").length;
for (var i = 0; i < fieldsetTestCount; ++i) {
fieldsetDescription = accessibilityController.accessibleElementById("f" + i).description;
debug(fieldsetDescription);
}
// legend tests.
legendValue = accessibilityController.accessibleElementById("l0").childAtIndex(0).stringValue;
debug(legendValue);
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>