blob: c90f966682eeec3433559809e092a8ac9f3714b7 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
</head>
<body id="body">
<p id="description">This tests that if both aria-labeledby and aria-labelledby are used (for reasons best known to the page author), then aria-labelledby is preferred.</p>
<button id="using-labelledby" aria-labelledby="epsilon" aria-label="Zeta">Delta</button>
<button id="using-labeledby" aria-labeledby="theta" aria-label="Iota">Eta</button>
<button id="using-labeledby-and-labelledby" aria-labelledby="epsilon" aria-labeledby="theta" aria-label="Iota">Eta</button>
<span id="epsilon">Using aria-labelledby</span>
<span id="theta">Using aria-labeledby</span>
<ul id="results"></ul>
<div id="console"></div>
<script>
function getAccessibilityObject(id) {
var element = document.getElementById(id);
element.focus();
return accessibilityController.focusedElement;
}
function output(str) {
var results = document.getElementById("results");
var li = document.createElement("li");
li.appendChild(document.createTextNode(str));
results.appendChild(li);
}
if (window.testRunner)
testRunner.dumpAsText();
if (window.accessibilityController) {
var usingLabelledby = getAccessibilityObject("using-labelledby");
output("usingLabelledby.deprecatedTitle: [" + usingLabelledby.deprecatedTitle + "]");
output("usingLabelledby.deprecatedDescription: [" + usingLabelledby.deprecatedDescription + "]");
var usingLabeledby = getAccessibilityObject("using-labeledby");
output("usingLabeledby.deprecatedTitle: [" + usingLabeledby.deprecatedTitle + "]");
output("usingLabeledby.deprecatedDescription: [" + usingLabeledby.deprecatedDescription + "]");
var usingLabeledbyAndLabelledby = getAccessibilityObject("using-labeledby-and-labelledby");
output("usingLabeledbyAndLabelledby.deprecatedTitle: [" + usingLabeledbyAndLabelledby.deprecatedTitle + "]");
output("usingLabeledbyAndLabelledby.deprecatedDescription: [" + usingLabeledbyAndLabelledby.deprecatedDescription + "]");
}
successfullyParsed = true;
</script>
</body>
</html>