mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
Bug 1316965: Give file inputs an a11y role of GROUPING so screen readers report their label when focus enters them. r=MarcoZ
Differential Revision: https://phabricator.services.mozilla.com/D46375 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
90f724704e
commit
79314daf0b
@ -410,9 +410,9 @@ HTMLFileInputAccessible::HTMLFileInputAccessible(nsIContent* aContent,
|
||||
}
|
||||
|
||||
role HTMLFileInputAccessible::NativeRole() const {
|
||||
// JAWS wants a text container, others don't mind. No specific role in
|
||||
// AT APIs.
|
||||
return roles::TEXT_CONTAINER;
|
||||
// No specific role in AT APIs. We use GROUPING so that the label will be
|
||||
// reported by screen readers when focus enters this control .
|
||||
return roles::GROUPING;
|
||||
}
|
||||
|
||||
nsresult HTMLFileInputAccessible::HandleAccEvent(AccEvent* aEvent) {
|
||||
|
@ -704,7 +704,7 @@
|
||||
// HTML:input@type="file"
|
||||
|
||||
obj = {
|
||||
TEXT_CONTAINER: [
|
||||
GROUPING: [
|
||||
{ role: ROLE_PUSHBUTTON },
|
||||
{ role: ROLE_LABEL },
|
||||
],
|
||||
|
@ -50,10 +50,8 @@
|
||||
testRole("head5", ROLE_HEADING);
|
||||
testRole("head6", ROLE_HEADING);
|
||||
|
||||
// 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.
|
||||
testRole("data", ROLE_TEXT_CONTAINER);
|
||||
// Test that an html:input @type="file" is exposed as ROLE_GROUPING.
|
||||
testRole("data", ROLE_GROUPING);
|
||||
|
||||
// Test that input type="checkbox" and type="radio" are
|
||||
// exposed as such regardless of appearance style.
|
||||
|
@ -17,7 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=483573
|
||||
<script type="application/javascript">
|
||||
function doTest() {
|
||||
var accTree = {
|
||||
role: ROLE_TEXT_CONTAINER,
|
||||
role: ROLE_GROUPING,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_PUSHBUTTON,
|
||||
|
Loading…
x
Reference in New Issue
Block a user