gecko/accessible/tests/mochitest/events/test_aria_objattr.html

109 lines
2.5 KiB
HTML
Raw Normal View History

<html>
<head>
<title>Accessible ARIA object attribute changes</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<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="../events.js"></script>
<script type="application/javascript">
/**
* Do tests.
*/
var gQueue = null;
function hideNode(aID, bHide)
{
this.node = getNode(aID);
this.accessible = getAccessible(this.node);
this.eventSeq = [
new invokerChecker(EVENT_OBJECT_ATTRIBUTE_CHANGED, this.accessible),
];
this.invoke = function hideNode_invoke()
{
this.node.setAttribute("aria-hidden", bHide);
}
this.getID = function hideNode_getID()
{
return "aria-hidden for " + aID + " " + bHide;
}
}
function updateSort(aID, aSort)
{
this.node = getNode(aID);
this.accessible = getAccessible(this.node);
this.eventSeq = [
new invokerChecker(EVENT_OBJECT_ATTRIBUTE_CHANGED, this.accessible),
];
this.invoke = function updateSort_invoke()
{
this.node.setAttribute("aria-sort", aSort);
}
this.getID = function updateSort_getID()
{
return "aria-sort for " + aID + " " + aSort;
}
}
// Debug stuff.
// gA11yEventDumpID = "eventdump";
// gA11yEventDumpToConsole = true;
function doTests()
{
gQueue = new eventQueue();
gQueue.push(new hideNode("hideable", "true"));
gQueue.push(new updateSort("sortable", "ascending"));
gQueue.invoke(); // Will call SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTests);
</script>
</head>
<body>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=581096"
title="Add support for aria-hidden">
Mozilla Bug 581096
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=640707"
title="Add event support for aria-sort">
Mozilla Bug 640707
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<div id="eventdump"></div>
<div id="hideable"><div>Hi</div><div>there</div></div>
<div id="sortable" role="columnheader" aria-sort"none">aria-sort</div>
</body>
</html>