Bug 1625184 - Map dialogs and alert dialogs correctly in Mac. r=MarcoZ

Differential Revision: https://phabricator.services.mozilla.com/D74957
This commit is contained in:
Eitan Isaacson 2020-05-13 05:59:23 +00:00
parent 208d1c7443
commit c1c0b3551c
4 changed files with 19 additions and 4 deletions

View File

@ -182,7 +182,7 @@ ROLE(CHART,
ROLE(DIALOG,
"dialog",
ATK_ROLE_DIALOG,
NSAccessibilityWindowRole, //There's a dialog subrole.
NSAccessibilityGroupRole, //There's a dialog subrole.
ROLE_SYSTEM_DIALOG,
ROLE_SYSTEM_DIALOG,
java::SessionAccessibility::CLASSNAME_DIALOG,

View File

@ -1139,6 +1139,7 @@ struct RoleDescrMap {
static const RoleDescrMap sRoleDescrMap[] = {
{@"AXApplicationAlert", NS_LITERAL_STRING("alert")},
{@"AXApplicationAlertDialog", NS_LITERAL_STRING("alertDialog")},
{@"AXApplicationDialog", NS_LITERAL_STRING("dialog")},
{@"AXApplicationLog", NS_LITERAL_STRING("log")},
{@"AXApplicationMarquee", NS_LITERAL_STRING("marquee")},
{@"AXApplicationStatus", NS_LITERAL_STRING("status")},

View File

@ -14,7 +14,7 @@ loadScripts(
/**
* Test different HTML elements for their roles and subroles
*/
function testRoleAndSubRole(accDoc, id, axRole, axSubRole) {
function testRoleAndSubRole(accDoc, id, axRole, axSubRole, axRoleDescription) {
let el = getNativeInterface(accDoc, id);
if (axRole) {
is(
@ -30,6 +30,13 @@ function testRoleAndSubRole(accDoc, id, axRole, axSubRole) {
"Subrole for " + id + " is " + axSubRole
);
}
if (axRoleDescription) {
is(
el.getAttributeValue("AXRoleDescription"),
axRoleDescription,
"Subrole for " + id + " is " + axRoleDescription
);
}
}
addAccessibleTask(
@ -105,10 +112,16 @@ addAccessibleTask(
// ARIA widget roles
testRoleAndSubRole(accDoc, "alert", null, "AXApplicationAlert");
testRoleAndSubRole(accDoc, "alertdialog", null, "AXApplicationAlertDialog");
testRoleAndSubRole(
accDoc,
"alertdialog",
"AXGroup",
"AXApplicationAlertDialog",
"alert dialog"
);
testRoleAndSubRole(accDoc, "article", null, "AXDocumentArticle");
testRoleAndSubRole(accDoc, "code", "AXGroup", "AXCodeStyleGroup");
testRoleAndSubRole(accDoc, "dialog", null, "AXApplicationDialog");
testRoleAndSubRole(accDoc, "dialog", null, "AXApplicationDialog", "dialog");
testRoleAndSubRole(accDoc, "ariaDocument", null, "AXDocument");
testRoleAndSubRole(accDoc, "log", null, "AXApplicationLog");
testRoleAndSubRole(accDoc, "marquee", null, "AXApplicationMarquee");

View File

@ -38,6 +38,7 @@ main = main
# The (spoken) role description for various WAI-ARIA roles
alert = alert
alertDialog = alert dialog
dialog = dialog
article = article
document = document
# The (spoken) role description for the WAI-ARIA figure role