Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
<html>
<head>
<title>HTML link states testing</title>
<link rel="stylesheet" type="text/css"
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../role.js"></script>
<script type="application/javascript"
src="../states.js"></script>
<script type="application/javascript"
src="../events.js"></script>
<script type="application/javascript">
function doTest() {
// a@href and its text node
testStates("link_href", STATE_LINKED);
testStates(getAccessible("link_href").firstChild, STATE_LINKED);
// a@onclick
testStates("link_click", STATE_LINKED);
// a@onmousedown
testStates("link_mousedown", STATE_LINKED);
// a@onmouseup
testStates("link_mouseup", STATE_LINKED);
// a@role="link"
testStates("link_arialink", STATE_LINKED);
// a@role="button"
testStates("link_ariabutton", 0, 0, STATE_LINKED);
// a (no @href, no click event listener)
testStates("link_notlink", 0, 0, STATE_LINKED);
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank"
title="Expose click action if mouseup and mousedown are registered">
</a>
<a target="_blank"
title="Calculate link states separately">
</a>
<a target="_blank"
title="Fire state change event when link is traversed">
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<a id="link_click" onclick="">link</a>
<a id="link_mousedown" onmousedown="">link</a>
<a id="link_mouseup" onmouseup="">link</a>
<a id="link_arialink" role="link">aria link</a>
<a id="link_ariabutton" role="button">aria button</a>
<a id="link_notlink">not link</a>
</body>
</html>