blob: 313a98471c27d360492583abb49dd79ed0ff9465 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test.js"></script>
</head>
<body id="body">
<ul id="tablist_1" role="tablist">
<li id="tab_1" role="tab" tabindex="0" class="">Crust</li>
<li id="tab_2" role="tab" tabindex="0" class="">Veges</li>
</ul>
<div id="panel_1" role="tabpanel" aria-labelledby="tab_1" >
<h3>Select Crust</h3>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that the aria roles for tab, tabpanel and tablist work as expected correctly.");
if (window.accessibilityController) {
var body = document.getElementById("body");
body.focus();
var tabList = accessibilityController.focusedElement.childAtIndex(0);
var tab1 = tabList.childAtIndex(0);
var tab2 = tabList.childAtIndex(1);
var tabPanel = accessibilityController.focusedElement.childAtIndex(1);
debug("tabList.role = " + tabList.role);
debug("tab1.role = " + tab1.role);
shouldBe("tab1.name", "'Crust'");
shouldBe("tab1.childrenCount", "0");
debug("tab2.role = " + tab2.role);
shouldBe("tab2.name", "'Veges'");
debug("tabPanel.role = " + tabPanel.role);
debug("tabPanel.subrole = " + tabPanel.subrole);
}
</script>
</body>
</html>