mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 14:15:30 +00:00
85f57ffd5d
--HG-- rename : accessible/tests/mochitest/test_aria_activedescendant.html => accessible/tests/mochitest/events/test_focus_aria_activedescendant.html rename : accessible/tests/mochitest/events/test_focus.html => accessible/tests/mochitest/events/test_focus_dialog.html rename : accessible/tests/mochitest/events/test_focusdoc.html => accessible/tests/mochitest/events/test_focus_doc.html rename : accessible/tests/mochitest/events/test_focus.xul => accessible/tests/mochitest/events/test_focus_general.xul rename : accessible/tests/mochitest/states/test_comboboxes.xul => accessible/tests/mochitest/states/test_expandable.xul rename : accessible/tests/mochitest/test_nsIAccessible_selects.html => accessible/tests/mochitest/states/test_selects.html
101 lines
2.8 KiB
HTML
101 lines
2.8 KiB
HTML
<html>
|
|
|
|
<head>
|
|
<title>nsIAccessible value testing</title>
|
|
|
|
<link rel="stylesheet" type="text/css"
|
|
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
|
|
|
<style type="text/css">
|
|
.offscreen {
|
|
position: absolute;
|
|
left: -5000px;
|
|
top: -5000px;
|
|
height: 100px;
|
|
width: 100px;
|
|
}
|
|
</style>
|
|
|
|
<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="chrome://mochikit/content/chrome-harness.js"></script>
|
|
|
|
<script type="application/javascript">
|
|
function doTest()
|
|
{
|
|
function testValue(aID, aValue)
|
|
{
|
|
var acc = getAccessible(aID);
|
|
if (!acc)
|
|
return;
|
|
is(acc.value, aValue, "Wrong value for " + aID + "!");
|
|
}
|
|
|
|
var rootDir = getRootDirectory(window.location.href);
|
|
var href = getRootDirectory(window.location.href) + "foo";
|
|
|
|
// roles that can't live as nsHTMLLinkAccessibles
|
|
testValue("aria_menuitem_link", "");
|
|
testValue("aria_button_link", "");
|
|
testValue("aria_checkbox_link", "");
|
|
testValue("aria_application_link", "");
|
|
|
|
// roles that can live as nsHTMLLinkAccessibles
|
|
testValue("aria_link_link", href);
|
|
testValue("aria_main_link", href);
|
|
testValue("aria_navigation_link", href);
|
|
|
|
// HTML controls
|
|
testValue("combobox1", "item1");
|
|
testValue("combobox2", "item2");
|
|
|
|
SimpleTest.finish();
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
addA11yLoadEvent(doTest);
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<a target="_blank"
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=494807"
|
|
title="Do not expose a11y info specific to hyperlinks when role is overridden using ARIA">
|
|
Mozilla Bug 494807
|
|
</a><br />
|
|
<p id="display"></p>
|
|
<div id="content" style="display: none">
|
|
</div>
|
|
<pre id="test">
|
|
</pre>
|
|
|
|
<a id="aria_menuitem_link" role="menuitem" href="foo">menuitem</a>
|
|
<a id="aria_button_link" role="button" href="foo">button</a>
|
|
<a id="aria_checkbox_link" role="checkbox" href="foo">checkbox</a>
|
|
|
|
<!-- landmark links -->
|
|
<a id="aria_application_link" role="application" href="foo">app</a>
|
|
<a id="aria_main_link" role="main" href="foo">main</a>
|
|
<a id="aria_navigation_link" role="navigation" href="foo">nav</a>
|
|
|
|
<!-- strange edge case: please don't do this in the wild -->
|
|
<a id="aria_link_link" role="link" href="foo">link</a>
|
|
|
|
<select id="combobox1">
|
|
<option id="cb1_item1">item1</option>
|
|
<option id="cb1_item2">item2</option>
|
|
</select>
|
|
<select id="combobox2">
|
|
<option id="cb2_item1">item1</option>
|
|
<option id="cb2_item2" selected="true">item2</option>
|
|
</select>
|
|
</body>
|
|
</html>
|