2008-10-30 03:39:17 -07:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=429547
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>aria-activedescendant property chrome 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"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="common.js"></script>
|
2008-10-30 03:39:17 -07:00
|
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
|
const ELEMENT_NODE = nsIDOMNode.ELEMENT_NODE;
|
|
|
|
|
|
|
|
var gContainerFocused = false;
|
|
|
|
|
|
|
|
function doTest()
|
|
|
|
{
|
|
|
|
var focusHandler = {
|
|
|
|
handleEvent: function handleEvent(aEvent) {
|
|
|
|
var target = aEvent.target;
|
|
|
|
if (target.nodeType == ELEMENT_NODE &&
|
|
|
|
target.getAttribute("id") == "container")
|
|
|
|
gContainerFocused = true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
var container = document.getElementById("container");
|
|
|
|
container.addEventListener("focus", focusHandler, false);
|
|
|
|
|
|
|
|
var item2Acc = getAccessible("item2");
|
|
|
|
if (item2Acc) {
|
|
|
|
item2Acc.takeFocus();
|
|
|
|
|
|
|
|
ok(gContainerFocused,
|
|
|
|
"Container with active descendant didn't receive the focus.");
|
|
|
|
}
|
|
|
|
|
|
|
|
container.removeEventListener("focus", focusHandler, false);
|
|
|
|
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2009-09-23 07:21:47 -07:00
|
|
|
addA11yLoadEvent(doTest);
|
2008-10-30 03:39:17 -07:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=429547"
|
|
|
|
title="Support aria-activedescendant usage in nsIAccesible::TakeFocus()">
|
|
|
|
Mozilla Bug 429547
|
|
|
|
</a>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none"></div>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<div aria-activedescendant="item1" id="container" tabindex="1">
|
|
|
|
<div id="item1">item1</div>
|
|
|
|
<div id="item2">item2</div>
|
|
|
|
<div id="item3">item3</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|