blob: d6c60dd91178d65f7afd8b4186868eb475eedfa8 [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">
<!-- N.B. The variety of whitespace chars separating the ids is deliberate -->
<div tabindex="0" id="test" role="group"
aria-flowto="flowto1 flowto2"
aria-owns="owned1 owned2"
aria-controls="controlled1
controlled2"
aria-details="details"
aria-errormessage="error"
aria-labelledby="label1 label2"
aria-describedby="description1 description2">
</div>
<div id="owned1" role="button">owned 1</div>
<div id="owned2" role="radio">owned 2</div>
<div id="controlled1" role="group" aria-label="controlled 1"></div>
<div id="controlled2" role="group" aria-label="controlled 2"></div>
<p id="label1">label 1</p>
<div id="label2">label 2</div>
<p id="description1">description 1</p>
<div id="description2">description 2</div>
<div tabindex="0" id="flowto1" role="group" aria-label="next group (1 of 2)" aria-describedby="description1"></div>
<div tabindex="0" id="flowto2" role="group" aria-label="next group (2 of 2)" aria-describedby="description2"></div>
<div id="details">Detailed descriptive information.</div>
<div id="error">Information about the error.</div>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
function info(axElement) {
if (!axElement)
return "(null)";
string = axElement.title.split("AXTitle: ")[1];
string = string ? string : axElement.stringValue.split("AXValue: ")[1];
return axElement.role.split("AXRole: ")[1] + ": '" + string + "'";
}
description("This verifies the exposure of aria-properties via accessible relations.");
if (window.accessibilityController) {
var axElement = accessibilityController.accessibleElementById("test");
var owned = axElement.ariaOwnsElementAtIndex(0);
var owner = owned.ariaOwnsReferencingElementAtIndex(0);
debug("axElement.ariaOwnsElementAtIndex(0): " + info(owned));
debug("owned.ariaOwnsReferencingElementAtIndex(0): " + info(owner));
owned = axElement.ariaOwnsElementAtIndex(1);
owner = owned.ariaOwnsReferencingElementAtIndex(0);
debug("\naxElement.ariaOwnsElementAtIndex(1): " + info(owned));
debug("owned.ariaOwnsReferencingElementAtIndex(0): " + info(owner));
var controlled = axElement.ariaControlsElementAtIndex(0);
var controller = controlled.ariaControlsReferencingElementAtIndex(0);
debug("\naxElement.ariaControlsElementAtIndex(0): " + info(controlled));
debug("controlled.ariaControlsReferencingElementAtIndex(0): " + info(controller));
controlled = axElement.ariaControlsElementAtIndex(1);
controller = controlled.ariaControlsReferencingElementAtIndex(0);
debug("\naxElement.ariaControlsElementAtIndex(1): " + info(controlled));
debug("controlled.ariaControlsReferencingElementAtIndex(0): " + info(controller));
var labelledBy = axElement.ariaLabelledByElementAtIndex(0);
var label = labelledBy.ariaLabelledByReferencingElementAtIndex(0);
debug("\naxElement.ariaLabelledByElementAtIndex(0): " + info(labelledBy));
debug("labelledBy.ariaLabelledByReferencingElementAtIndex(0): " + info(label));
labelledBy = axElement.ariaLabelledByElementAtIndex(1);
label = labelledBy.ariaLabelledByReferencingElementAtIndex(0);
debug("\naxElement.ariaLabelledByElementAtIndex(1): " + info(labelledBy));
debug("labelledBy.ariaLabelledByReferencingElementAtIndex(0): " + info(label));
var describedBy = axElement.ariaDescribedByElementAtIndex(0);
var descriptionFor = describedBy.ariaDescribedByReferencingElementAtIndex(0);
var alsoDescriptionFor = describedBy.ariaDescribedByReferencingElementAtIndex(1);
debug("\naxElement.ariaDescribedByElementAtIndex(0): " + info(describedBy));
debug("describedBy.ariaDescribedByReferencingElementAtIndex(0): " + info(descriptionFor));
debug("describedBy.ariaDescribedByReferencingElementAtIndex(1): " + info(alsoDescriptionFor));
describedBy = axElement.ariaDescribedByElementAtIndex(1);
descriptionFor = describedBy.ariaDescribedByReferencingElementAtIndex(0);
alsoDescriptionFor = describedBy.ariaDescribedByReferencingElementAtIndex(1);
debug("\naxElement.ariaDescribedByElementAtIndex(1): " + info(describedBy));
debug("describedBy.ariaDescribedByReferencingElementAtIndex(0): " + info(descriptionFor));
debug("describedBy.ariaDescribedByReferencingElementAtIndex(1): " + info(alsoDescriptionFor));
var flowTo = axElement.ariaFlowToElementAtIndex(0);
var flowFrom = flowTo.ariaFlowToReferencingElementAtIndex(0);
debug("\naxElement.ariaFlowToElementAtIndex(0): " + info(flowTo));
debug("flowTo.ariaFlowToReferencingElementAtIndex(0): " + info(flowFrom));
flowTo = axElement.ariaFlowToElementAtIndex(1);
flowFrom = flowTo.ariaFlowToReferencingElementAtIndex(0);
debug("\naxElement.ariaFlowToElementAtIndex(1): " + info(flowTo));
debug("flowTo.ariaFlowToReferencingElementAtIndex(0): " + info(flowFrom));
var details = axElement.ariaDetailsElementAtIndex(0);
var detailsFor = details.ariaDetailsReferencingElementAtIndex(0);
debug("\naxElement.ariaDetailsElementAtIndex(0): " + info(details));
debug("details.ariaDetailsReferencingElementAtIndex(0): " + info(detailsFor));
var error = axElement.ariaErrorMessageElementAtIndex(0);
var errorFor = error.ariaErrorMessageReferencingElementAtIndex(0);
debug("\naxElement.ariaErrorMessageElementAtIndex(0): " + info(error));
debug("error.ariaErrorMessageReferencingElementAtIndex(0): " + info(errorFor));
document.getElementById("content").style.visibility = "hidden";
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>