blob: 3b14bf36579020785312223f3548736e560109f9 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body id="body">
<nav role="navigation">
<!-- All of these eval to 'false' -->
<ul><li><a class="ex" data-expected="false" href="/">Nav1</a></li></ul>
<ul><li><a class="ex" data-expected="false" href="/" aria-current="false">Nav2</a></li></ul>
<ul><li><a class="ex" data-expected="false" href="/" aria-current="">Nav3</a></li></ul>
<ul><li><a class="ex" data-expected="false" href="/" aria-current=" ">Nav4</a></li></ul>
<ul><li><a class="ex" data-expected="false" href="/" aria-current=" ">Nav5</a></li></ul> <!-- tab char -->
<ul><li><a class="ex" data-expected="false" href="/" aria-current="
">Nav6</a></li></ul> <!-- newline char -->
<!-- Known token values in ARIA 1.1 -->
<ul><li><a class="ex" data-expected="page" href="/" aria-current="page">Nav7</a></li></ul>
<ul><li><a class="ex" data-expected="step" href="/" aria-current="step">Nav8</a></li></ul>
<ul><li><a class="ex" data-expected="location" href="/" aria-current="location">Nav9</a></li></ul>
<ul><li><a class="ex" data-expected="date" href="/" aria-current="date">Nav10</a></li></ul>
<ul><li><a class="ex" data-expected="time" href="/" aria-current="time">Nav11</a></li></ul>
<ul><li><a class="ex" data-expected="true" href="/" aria-current="true">Nav12</a></li></ul>
<!-- All other string values -->
<ul><li><a class="ex" data-expected="true" href="/" aria-current="sometext">Nav13</a></li></ul>
<ul><li><a class="ex" data-expected="true" href="/" aria-current="page step">Nav14</a></li></ul>
<ul><li><a class="ex" data-expected="page" href="/" aria-current="page ">Nav15</a></li></ul>
<ul><li><a class="ex" data-expected="step" href="/" aria-current=" step ">Nav16</a></li></ul>
</nav>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that aria-current causes the right attribute to be returned.");
function verify(value, expectation, element) {
if (value === expectation)
debug("PASS: AXARIACurrent is " + value);
else
debug("FAIL: AXARIACurrent is " + value + ". Expected: " + expectation + ". " + (element ? element.outerHTML : ""));
}
if (window.accessibilityController) {
var examples = document.querySelectorAll(".ex");
for (var i = 0, c = examples.length; i < c; i++) {
var el = examples[i];
el.focus();
var expectation = el.getAttribute("data-expected");
var value = accessibilityController.focusedElement.stringAttributeValue('AXARIACurrent');
verify(value, expectation, el);
}
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>