Bug 1829028: Explicitly support term, definition ARIA roles, r=Jamie

This revision aims to add support for the 'term' and 'definition' ARIA roles.
These roles already exist in Gecko, but aren't fully mapped where they should
be. To address the problem, this revision adds a static atom for "definition,"
implements the ARIA map for definition, adds a markup map entry for the dfn
element (which has the DEFINITION role), and puts the term and definition atoms
in the role map. As a consequence of these changes, this revision also removes
the expected web platform test failures and updates other existing tests.

Differential Revision: https://phabricator.services.mozilla.com/D200219
This commit is contained in:
Nathan LaPre 2024-02-06 03:50:29 +00:00
parent 66d12d2fff
commit 6b8a3f8047
7 changed files with 23 additions and 24 deletions

View File

@ -211,6 +211,15 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
eLandmark,
kNoReqStates
},
{ // definition
nsGkAtoms::definition,
roles::DEFINITION,
kUseMapRole,
eNoValue,
eNoAction,
eNoLiveAttr,
kGenericAccType,
},
{ // deletion
nsGkAtoms::deletion,
roles::CONTENT_DELETION,

View File

@ -68,6 +68,8 @@ MARKUPMAP(del, New_HyperText, roles::CONTENT_DELETION)
MARKUPMAP(details, New_HyperText, roles::DETAILS)
MARKUPMAP(dfn, New_HyperText, roles::TERM)
MARKUPMAP(dialog, New_HyperText, roles::DIALOG)
MARKUPMAP(

View File

@ -845,7 +845,7 @@ ROLE(DEFINITION_LIST,
ROLE(TERM,
"term",
nullptr,
nsGkAtoms::term,
ATK_ROLE_DESCRIPTION_TERM,
NSAccessibilityGroupRole,
@"AXTerm",
@ -856,7 +856,7 @@ ROLE(TERM,
ROLE(DEFINITION,
"definition",
nullptr,
nsGkAtoms::definition,
ATK_ROLE_PARAGRAPH,
NSAccessibilityGroupRole,
@"AXDescription",

View File

@ -406,11 +406,17 @@
obj = {
role: ROLE_PARAGRAPH,
textAttrs: {
0: { "font-style": "italic" },
12: { },
0: { },
1: { },
},
children: [
{ role: ROLE_TEXT_LEAF }, // HTML:dfn text
{
role: ROLE_TERM, // HTML:dfn
textAttrs: { 0: { }, },
children: [
{ role: ROLE_TEXT_LEAF },
],
},
{ role: ROLE_TEXT_LEAF }, // plain text
],
};

View File

@ -7,14 +7,3 @@
[el-time]
expected: FAIL
[el-dfn]
expected: FAIL
[el-dd]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1829028
expected: FAIL
[el-dt]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1829028
expected: FAIL

View File

@ -1,8 +1,4 @@
[roles.html]
[role: definition]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1829028
[role: emphasis]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1732306
@ -14,7 +10,3 @@
[role: time]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1732306
[role: term]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1829028

View File

@ -1698,6 +1698,7 @@ STATIC_ATOMS = [
Atom("csp", "csp"),
Atom("curl_", "curl"),
Atom("decimalpoint_", "decimalpoint"),
Atom("definition", "definition"),
Atom("definitionURL_", "definitionURL"),
Atom("degree_", "degree"),
Atom("denomalign_", "denomalign"),