gecko/accessible/tests/mochitest/test_elm_landmarks.html

73 lines
2.3 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_SECTION);
testRole("aside", ROLE_NOTE);
// 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("article", {"xml-roles" : "main"}, true);
testAttrs("aside", {"xml-roles" : "note"}, true);
testAttrs("document", {"xml-roles" : "document"}, 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("document", {"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">Bug 593368</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>
<article id="article">an article</article>
<aside id="aside">by the way I am an aside</aside>
<article id="document" role="document">a document</article>
</body>
</html>