gecko/accessible/tests/mochitest/test_elm_landmarks.html

81 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>HTML landmark tests</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="common.js"></script>
<script type="application/javascript"
src="role.js"></script>
<script type="application/javascript"
src="attributes.js"></script>
<script type="application/javascript">
function doTest()
{
testRole("nav", ROLE_SECTION);
testRole("header", ROLE_HEADER);
testRole("footer", ROLE_FOOTER);
testRole("article", ROLE_DOCUMENT);
testRole("aside", ROLE_NOTE);
testRole("main", ROLE_DOCUMENT);
// Some AT may look for this
testAttrs("nav", {"xml-roles" : "navigation"}, true);
testAttrs("header", {"xml-roles" : "banner"}, true);
testAttrs("footer", {"xml-roles" : "contentinfo"}, true);
testAttrs("aside", {"xml-roles" : "note"}, true);
testAttrs("main", {"xml-roles" : "main"}, true); // ARIA override
// And some AT may look for this
testAttrs("nav", {"tag" : "NAV"}, true);
testAttrs("header", {"tag" : "HEADER"}, true);
testAttrs("footer", {"tag" : "FOOTER"}, true);
testAttrs("article", {"tag" : "ARTICLE"}, true);
testAttrs("aside", {"tag" : "ASIDE"}, true);
testAttrs("main", {"tag" : "ARTICLE"}, true); // no override expected
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank"
title="Provide mappings for html5 <nav> <header> <footer> <article>"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=593368">
Mozilla Bug 593368
</a><br/>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=613502"
title="Map <article> like we do aria role article">
Mozilla Bug 613502
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<nav id="nav">a nav</nav>
<header id="header">a header</header>
<footer id="footer">a footer</footer>
<aside id="aside">by the way I am an aside</aside>
<article id="article">an article</article>
<article id="main" role="main">a main area</article>
</body>
</html>