blob: 9b448a3b10c721745be6f2276afe8e5c8021751e [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
</head>
<body id="body">
<button id="using-none">Alpha</button>
<button id="using-label" aria-label="Gamma">Beta</button>
<button id="using-labelledby" aria-labelledby="epsilon" aria-label="Zeta">Delta</button>
<button id="using-labeledby" aria-labeledby="theta" aria-label="Iota">Eta</button>
<span id="epsilon">Epsilon</span>
<span id="theta">Theta</span>
<script>
test((t) => {
var usingNone = accessibilityController.accessibleElementById("using-none");
assert_equals(usingNone.name, "Alpha");
var usingLabel = accessibilityController.accessibleElementById("using-label");
assert_equals(usingLabel.name, "Gamma");
var usingLabelledby = accessibilityController.accessibleElementById("using-labelledby");
assert_equals(usingLabelledby.name, "Epsilon");
var usingLabeledby = accessibilityController.accessibleElementById("using-labeledby");
assert_equals(usingLabeledby.name, "Theta");
}, "This tests that if aria-labelledby is used, then aria-label attributes are not used.");
</script>
</body>
</html>