bug 472326 - html:input of type file no longer rendered to screen readers, effective December 30, 2008, r=aaronlev, r=surkov

This commit is contained in:
Marco Zehe 2009-01-15 15:45:43 +01:00
Родитель d8ffe37308
Коммит e5b7c65145
4 изменённых файлов: 65 добавлений и 1 удалений

Просмотреть файл

@ -159,7 +159,10 @@ NS_IMETHODIMP nsHyperTextAccessible::GetRole(PRUint32 *aRole)
}
else {
nsIFrame *frame = GetFrame();
if (frame && frame->GetType() == nsAccessibilityAtoms::blockFrame) {
if (frame && frame->GetType() == nsAccessibilityAtoms::blockFrame &&
frame->GetContent()->Tag() != nsAccessibilityAtoms::input) {
// An html:input @type="file" is the only input that is exposed as a
// blockframe. It must be exposed as ROLE_TEXT_CONTAINER for JAWS.
*aRole = nsIAccessibleRole::ROLE_PARAGRAPH;
}
else {

Просмотреть файл

@ -69,6 +69,7 @@ _TEST_FILES =\
test_groupattrs.xul \
test_groupattrs.html \
$(warning test_table_indexes.html temporarily disabled) \
test_nsHyperTextAcc_roles.html \
test_nsIAccessible_actions.html \
$(warning test_nsIAccessible_actions.xul temporarily disabled) \
test_nsIAccessible_applicationAccessible.html \

Просмотреть файл

@ -49,7 +49,9 @@ const ROLE_FLAT_EQUATION = nsIAccessibleRole.ROLE_FLAT_EQUATION;
const ROLE_LABEL = nsIAccessibleRole.ROLE_LABEL;
const ROLE_LIST = nsIAccessibleRole.ROLE_LIST;
const ROLE_OPTION = nsIAccessibleRole.ROLE_OPTION;
const ROLE_PARAGRAPH = nsIAccessibleRole.ROLE_PARAGRAPH;
const ROLE_PASSWORD_TEXT = nsIAccessibleRole.ROLE_PASSWORD_TEXT;
const ROLE_TEXT_CONTAINER = nsIAccessibleRole.ROLE_TEXT_CONTAINER;
const ROLE_TEXT_LEAF = nsIAccessibleRole.ROLE_TEXT_LEAF;
const ROLE_TOGGLE_BUTTON = nsIAccessibleRole.ROLE_TOGGLE_BUTTON;

Просмотреть файл

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=472326
-->
<head>
<title>test nsHyperTextAccessible roles</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="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript">
function doTests()
{
// Test that an html:input @type="file" is exposed as ROLE_TEXT_CONTAINER.
// After fix for bug 471356, it was temporarily exposed as a paragraph,
// breaking JAWS compatibility.
fileUploadAcc = getAccessible("data");
if (fileUploadAcc)
is(fileUploadAcc.role, ROLE_TEXT_CONTAINER,
"Wrong role for file upload textbox!");
// Test regular paragraph by comparison to make sure exposure does not
// get broken.
var paraAcc = getAccessible("p");
if (paraAcc)
is(paraAcc.role, ROLE_PARAGRAPH, "Wrong role for paragraph!");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(doTests);
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=472326"
title="html:input of type "file" no longer rendered to screen readers">
Mozilla Bug 472326
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<form action="submit.php" method="post">
<label for="data">File</label>:
<input type="file" id="data" name="data" size="50"/>
</form>
<p id="p">A paragraph for comparison.</p>
</body>
</html>