Skip to content

Commit 447963a

Browse files
author
Nathan LaPre
committed
Bug 1732306 - Part 3: Implement time role mappings, r=Jamie
This revision adds role mappings for the 'time' ARIA role by implementing HTML markup mapping, adding platform mappings, and adding the role info itself. This revision also enables the previously-failed wpt tests and fixes other tests. Differential Revision: https://phabricator.services.mozilla.com/D200132
1 parent db33b5d commit 447963a

File tree

8 files changed

+28
-7
lines changed

8 files changed

+28
-7
lines changed

accessible/base/ARIAMap.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,15 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
12991299
eARIAMultiline,
13001300
eARIAReadonlyOrEditable
13011301
},
1302+
{ // time
1303+
nsGkAtoms::time,
1304+
roles::TIME,
1305+
kUseMapRole,
1306+
eNoValue,
1307+
eNoAction,
1308+
eNoLiveAttr,
1309+
kNoReqStates
1310+
},
13021311
{ // timer
13031312
nsGkAtoms::timer,
13041313
roles::NOTHING,

accessible/base/HTMLMarkupMap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ MARKUPMAP(
368368
},
369369
roles::TABLE)
370370

371-
MARKUPMAP(time, New_HyperText, 0, Attr(xmlroles, time),
371+
MARKUPMAP(time, New_HyperText, roles::TIME, Attr(xmlroles, time),
372372
AttrFromDOM(datetime, datetime))
373373

374374
MARKUPMAP(tbody, nullptr, roles::GROUPING)

accessible/base/RoleMap.h

+11
Original file line numberDiff line numberDiff line change
@@ -1532,4 +1532,15 @@ ROLE(STRONG,
15321532
java::SessionAccessibility::CLASSNAME_VIEW,
15331533
eNameFromSubtreeIfReqRule)
15341534

1535+
ROLE(TIME,
1536+
"time",
1537+
nsGkAtoms::time,
1538+
ATK_ROLE_STATIC,
1539+
NSAccessibilityGroupRole,
1540+
@"AXTimeGroup",
1541+
ROLE_SYSTEM_GROUPING,
1542+
ROLE_SYSTEM_GROUPING,
1543+
java::SessionAccessibility::CLASSNAME_VIEW,
1544+
eNameFromSubtreeIfReqRule)
1545+
15351546
// clang-format on

accessible/interfaces/nsIAccessibleRole.idl

+5
Original file line numberDiff line numberDiff line change
@@ -794,4 +794,9 @@ interface nsIAccessibleRole : nsISupports
794794
* Represents content that is important, serious, or urgent.
795795
*/
796796
const unsigned long ROLE_STRONG = 136;
797+
798+
/**
799+
* Represents a specific point in time.
800+
*/
801+
const unsigned long ROLE_TIME = 137;
797802
};

accessible/tests/mochitest/elm/test_HTMLSpec.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@
14731473
// HTML:time
14741474

14751475
obj = {
1476-
role: ROLE_TEXT,
1476+
role: ROLE_TIME,
14771477
attributes: { "xml-roles": "time", "datetime": "2001-05-15 19:00" },
14781478
interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
14791479
};

accessible/tests/mochitest/role.js

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ const ROLE_TERM = nsIAccessibleRole.ROLE_TERM;
132132
const ROLE_TEXT = nsIAccessibleRole.ROLE_TEXT;
133133
const ROLE_TEXT_CONTAINER = nsIAccessibleRole.ROLE_TEXT_CONTAINER;
134134
const ROLE_TEXT_LEAF = nsIAccessibleRole.ROLE_TEXT_LEAF;
135+
const ROLE_TIME = nsIAccessibleRole.ROLE_TIME;
135136
const ROLE_TIME_EDITOR = nsIAccessibleRole.ROLE_TIME_EDITOR;
136137
const ROLE_TOGGLE_BUTTON = nsIAccessibleRole.ROLE_TOGGLE_BUTTON;
137138
const ROLE_TOOLBAR = nsIAccessibleRole.ROLE_TOOLBAR;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
[roles.html]
2-
[el-time]
3-
expected: FAIL
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
[roles.html]
2-
[role: time]
3-
expected: FAIL
4-
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1732306

0 commit comments

Comments
 (0)