blob: 150597e23b74059a652bf49cb1631ce4e3bb2649 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body id="body">
<div role="button">test</div>
<div style="position: relative; left: 100px">
<iframe id="frame" scrolling=YES width=100 height=100 border=1 title="iframe" src="resources/cake.png"></iframe>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This makes sure that if an iframe has a title attribute, it will still show up in the hierarchy correctly.");
if (window.accessibilityController) {
document.getElementById("body").focus();
var bodyElement = accessibilityController.focusedElement;
document.getElementById("frame").focus();
// scroll area -> web area -> group -> iframe (scroll area)
var iframeScroll = accessibilityController.rootElement.childAtIndex(0).childAtIndex(1).childAtIndex(0);
shouldBe("iframeScroll.role", "'AXRole: AXScrollArea'");
shouldBe("iframeScroll.parentElement().role", "'AXRole: AXGroup'");
shouldBe("iframeScroll.parentElement().parentElement().role", "'AXRole: AXWebArea'");
shouldBeTrue("iframeScroll.parentElement().parentElement().isEqual(bodyElement)");
// web area (of scroll area)
var iframeWeb = iframeScroll.childAtIndex(0);
shouldBeTrue("iframeWeb.parentElement().isEqual(iframeScroll)");
var x = iframeWeb.x + 5;
var y = iframeWeb.y + 5;
var hitTest = accessibilityController.elementAtPoint(x, y);
shouldBeTrue("hitTest.isEqual(iframeWeb)");
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>