blob: 55bea162fb082a7b1633ba076efd6669440ff3f9 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<script src="../resources/accessibility-helper.js"></script>
<title>aria-labelledby Overrides aria-labeledby</title>
</head>
<body>
<div id="test">
<a aria-labeledby="x1 x2" aria-labelledby="y1 y2" href="#" id="link">X</a>
<!-- Incorrectly spelled aria-labelledby attribute labels. -->
<span id="x1">I</span>
<span id="x2">J</span>
<!-- Correctly spelled aria-labelledby attribute labels. -->
<span id="y1">Y</span>
<span id="y2">Z</span>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that aria-labelledby overrides aria-labeledby correctly.");
if (window.accessibilityController) {
var axLink = accessibilityController.accessibleElementById("link");
shouldBeEqualToString("platformValueForW3CName(axLink)", "Y Z");
// Hide superfluous text.
document.getElementById("test").style.display = "none";
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>