diff --git a/accessible/base/ARIAMap.cpp b/accessible/base/ARIAMap.cpp index 6c13f3ddae3f..5f93a340ed2b 100644 --- a/accessible/base/ARIAMap.cpp +++ b/accessible/base/ARIAMap.cpp @@ -1299,6 +1299,15 @@ static const nsRoleMapEntry sWAIRoleMaps[] = { eARIAMultiline, eARIAReadonlyOrEditable }, + { // time + nsGkAtoms::time, + roles::TIME, + kUseMapRole, + eNoValue, + eNoAction, + eNoLiveAttr, + kNoReqStates + }, { // timer nsGkAtoms::timer, roles::NOTHING, diff --git a/accessible/base/HTMLMarkupMap.h b/accessible/base/HTMLMarkupMap.h index 6151e3433f09..b903097ea03d 100644 --- a/accessible/base/HTMLMarkupMap.h +++ b/accessible/base/HTMLMarkupMap.h @@ -368,7 +368,7 @@ MARKUPMAP( }, roles::TABLE) -MARKUPMAP(time, New_HyperText, 0, Attr(xmlroles, time), +MARKUPMAP(time, New_HyperText, roles::TIME, Attr(xmlroles, time), AttrFromDOM(datetime, datetime)) MARKUPMAP(tbody, nullptr, roles::GROUPING) diff --git a/accessible/base/RoleMap.h b/accessible/base/RoleMap.h index 7ee87779e2cc..ce820001885b 100644 --- a/accessible/base/RoleMap.h +++ b/accessible/base/RoleMap.h @@ -1532,4 +1532,15 @@ ROLE(STRONG, java::SessionAccessibility::CLASSNAME_VIEW, eNameFromSubtreeIfReqRule) +ROLE(TIME, + "time", + nsGkAtoms::time, + ATK_ROLE_STATIC, + NSAccessibilityGroupRole, + @"AXTimeGroup", + ROLE_SYSTEM_GROUPING, + ROLE_SYSTEM_GROUPING, + java::SessionAccessibility::CLASSNAME_VIEW, + eNameFromSubtreeIfReqRule) + // clang-format on diff --git a/accessible/interfaces/nsIAccessibleRole.idl b/accessible/interfaces/nsIAccessibleRole.idl index 9b98b474073c..e8024063c1b4 100644 --- a/accessible/interfaces/nsIAccessibleRole.idl +++ b/accessible/interfaces/nsIAccessibleRole.idl @@ -794,4 +794,9 @@ interface nsIAccessibleRole : nsISupports * Represents content that is important, serious, or urgent. */ const unsigned long ROLE_STRONG = 136; + + /** + * Represents a specific point in time. + */ + const unsigned long ROLE_TIME = 137; }; diff --git a/accessible/tests/mochitest/elm/test_HTMLSpec.html b/accessible/tests/mochitest/elm/test_HTMLSpec.html index 9fe835a61a1c..082be79ba748 100644 --- a/accessible/tests/mochitest/elm/test_HTMLSpec.html +++ b/accessible/tests/mochitest/elm/test_HTMLSpec.html @@ -1473,7 +1473,7 @@ // HTML:time obj = { - role: ROLE_TEXT, + role: ROLE_TIME, attributes: { "xml-roles": "time", "datetime": "2001-05-15 19:00" }, interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ], }; diff --git a/accessible/tests/mochitest/role.js b/accessible/tests/mochitest/role.js index 93219d1eaef7..07b820c2acc2 100644 --- a/accessible/tests/mochitest/role.js +++ b/accessible/tests/mochitest/role.js @@ -132,6 +132,7 @@ const ROLE_TERM = nsIAccessibleRole.ROLE_TERM; const ROLE_TEXT = nsIAccessibleRole.ROLE_TEXT; const ROLE_TEXT_CONTAINER = nsIAccessibleRole.ROLE_TEXT_CONTAINER; const ROLE_TEXT_LEAF = nsIAccessibleRole.ROLE_TEXT_LEAF; +const ROLE_TIME = nsIAccessibleRole.ROLE_TIME; const ROLE_TIME_EDITOR = nsIAccessibleRole.ROLE_TIME_EDITOR; const ROLE_TOGGLE_BUTTON = nsIAccessibleRole.ROLE_TOGGLE_BUTTON; const ROLE_TOOLBAR = nsIAccessibleRole.ROLE_TOOLBAR; diff --git a/testing/web-platform/meta/html-aam/roles.html.ini b/testing/web-platform/meta/html-aam/roles.html.ini index 4dd7cb816a42..f034ca2a26c3 100644 --- a/testing/web-platform/meta/html-aam/roles.html.ini +++ b/testing/web-platform/meta/html-aam/roles.html.ini @@ -1,3 +1 @@ [roles.html] - [el-time] - expected: FAIL diff --git a/testing/web-platform/meta/wai-aria/role/roles.html.ini b/testing/web-platform/meta/wai-aria/role/roles.html.ini index cb76fd2001b9..f034ca2a26c3 100644 --- a/testing/web-platform/meta/wai-aria/role/roles.html.ini +++ b/testing/web-platform/meta/wai-aria/role/roles.html.ini @@ -1,4 +1 @@ [roles.html] - [role: time] - expected: FAIL - bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1732306