gecko/accessible/tests/mochitest/test_nsIAccessNode_utils.html

56 lines
1.6 KiB
HTML
Raw Normal View History

<html>
<head>
<title>nsIAccessNode util methods testing</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"
src="common.js"></script>
<script type="application/javascript">
function doTest()
{
var elmObj = {};
var acc = getAccessible("span", [nsIAccessNode], elmObj);
computedStyle = document.defaultView.getComputedStyle(elmObj.value, "");
// html:span element
is(acc.getComputedStyleValue("", "color"), computedStyle.color,
"Wrong color for element with ID 'span'");
// text child of html:span element
acc = getAccessible(acc.firstChild, [nsIAccessNode]);
is(acc.getComputedStyleValue("", "color"), computedStyle.color,
"Wrong color for text child of element with ID 'span'");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=454211"
title="nsIAccessNode util methods testing">
Mozilla Bug 454211
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<span role="note" style="color: red" id="span">text</span>
</body>
</html>