Skip to content

Commit db33b5d

Browse files
author
Nathan LaPre
committed
Bug 1732306 - Part 2: Implement strong role mappings, r=Jamie
This revision implements mapping for the ARIA 1.2 'strong' role by adding a markup mapping, a role definition, and platform mappings. This revision also removes the expected failures in the wpt test suite and fixes other tests. Differential Revision: https://phabricator.services.mozilla.com/D200131
1 parent 61034e5 commit db33b5d

File tree

8 files changed

+34
-8
lines changed

8 files changed

+34
-8
lines changed

accessible/base/ARIAMap.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,16 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
11831183
kGenericAccType,
11841184
kNoReqStates
11851185
},
1186+
{ // strong
1187+
nsGkAtoms::strong,
1188+
roles::STRONG,
1189+
kUseMapRole,
1190+
eNoValue,
1191+
eNoAction,
1192+
eNoLiveAttr,
1193+
kGenericAccType,
1194+
kNoReqStates
1195+
},
11861196
{ // subscript
11871197
nsGkAtoms::subscript,
11881198
roles::SUBSCRIPT,

accessible/base/HTMLMarkupMap.h

+2
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ MARKUPMAP(
348348
},
349349
0)
350350

351+
MARKUPMAP(strong, New_HyperText, roles::STRONG)
352+
351353
MARKUPMAP(sub, New_HyperText, roles::SUBSCRIPT)
352354

353355
MARKUPMAP(

accessible/base/RoleMap.h

+11
Original file line numberDiff line numberDiff line change
@@ -1521,4 +1521,15 @@ ROLE(EMPHASIS,
15211521
java::SessionAccessibility::CLASSNAME_VIEW,
15221522
eNameFromSubtreeIfReqRule)
15231523

1524+
ROLE(STRONG,
1525+
"strong",
1526+
nsGkAtoms::strong,
1527+
ATK_ROLE_STATIC,
1528+
NSAccessibilityGroupRole,
1529+
@"AXStrongStyleGroup",
1530+
ROLE_SYSTEM_GROUPING,
1531+
IA2_ROLE_TEXT_FRAME,
1532+
java::SessionAccessibility::CLASSNAME_VIEW,
1533+
eNameFromSubtreeIfReqRule)
1534+
15241535
// clang-format on

accessible/interfaces/nsIAccessibleRole.idl

+4
Original file line numberDiff line numberDiff line change
@@ -790,4 +790,8 @@ interface nsIAccessibleRole : nsISupports
790790
*/
791791
const unsigned long ROLE_EMPHASIS = 135;
792792

793+
/**
794+
* Represents content that is important, serious, or urgent.
795+
*/
796+
const unsigned long ROLE_STRONG = 136;
793797
};

accessible/tests/mochitest/elm/test_HTMLSpec.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,12 @@
13921392
role: ROLE_PARAGRAPH,
13931393
children: [
13941394
{ role: ROLE_TEXT_LEAF }, // plain text
1395-
{ role: ROLE_TEXT_LEAF }, // HTML:strong text
1395+
{
1396+
role: ROLE_STRONG, // HTML:strong text
1397+
children: [
1398+
{ role: ROLE_TEXT_LEAF, },
1399+
],
1400+
},
13961401
],
13971402
};
13981403
testElm("strong_container", obj);

accessible/tests/mochitest/role.js

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ const ROLE_SLIDER = nsIAccessibleRole.ROLE_SLIDER;
121121
const ROLE_SPINBUTTON = nsIAccessibleRole.ROLE_SPINBUTTON;
122122
const ROLE_STATICTEXT = nsIAccessibleRole.ROLE_STATICTEXT;
123123
const ROLE_STATUSBAR = nsIAccessibleRole.ROLE_STATUSBAR;
124+
const ROLE_STRONG = nsIAccessibleRole.ROLE_STRONG;
124125
const ROLE_SUBSCRIPT = nsIAccessibleRole.ROLE_SUBSCRIPT;
125126
const ROLE_SUGGESTION = nsIAccessibleRole.ROLE_SUGGESTION;
126127
const ROLE_SUPERSCRIPT = nsIAccessibleRole.ROLE_SUPERSCRIPT;
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
[roles.html]
2-
[el-strong]
3-
expected: FAIL
4-
52
[el-time]
63
expected: FAIL
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
[roles.html]
2-
[role: strong]
3-
expected: FAIL
4-
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1732306
5-
62
[role: time]
73
expected: FAIL
84
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1732306

0 commit comments

Comments
 (0)