blob: a1199f368437789a31fa9408a817a0639c4b90f1 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body id="body">
<p>Simple paragraph</p>
<p role="grid">A paragraph pretending to be a table</p>
<label>A label</label>
<label role="heading">Who said label? It's a heading!</label>
<form>A form with a button <button name="button" value="Button">Click me!</button></form>
<form role="button">Just a button <button name="button" value="Button">Click me!</button></form>
<div>Just some text inside a div</div>
<div role="textbox">This div is contains a textbox (an entry)</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that ARIA roles are not ignored for 'p','label', 'form' and 'div' elements");
if (window.layoutController) {
testRunner.dumpAsText();
}
if (window.accessibilityController) {
document.getElementById("body").focus();
var webArea = accessibilityController.focusedElement;
// Paragraphs
var element = webArea.childAtIndex(0);
shouldBe("element.role", "'AXRole: AXParagraph'");
element = webArea.childAtIndex(1);
shouldBe("element.role", "'AXRole: AXTable'");
// Labels are exposed as inside a panel
var labelsPanel = webArea.childAtIndex(2);
element = labelsPanel.childAtIndex(0);
shouldBe("element.role", "'AXRole: AXLabel'");
element = labelsPanel.childAtIndex(1);
shouldBe("element.role", "'AXRole: AXHeading'");
// Forms
element = webArea.childAtIndex(3);
shouldBe("element.role", "'AXRole: AXForm'");
element = webArea.childAtIndex(4);
shouldBe("element.role", "'AXRole: AXButton'");
// Divs
element = webArea.childAtIndex(5);
shouldBe("element.role", "'AXRole: AXSection'");
element = webArea.childAtIndex(6);
shouldBe("element.role", "'AXRole: AXTextField'");
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>