From 5e6c99f2edb62cef0d0e6a3b100ebacf8540e6f6 Mon Sep 17 00:00:00 2001 From: Nathan LaPre Date: Thu, 8 Feb 2024 17:49:42 +0000 Subject: [PATCH] Bug 1732306 - Part 4: Implement generic role mapping, r=Jamie This revision 'implements' the 'generic' ARIA role mapping by mapping ARIA 'generic' to Gecko 'section.' This isn't a full implementation of 'generic' - it sidesteps it to avoid dealing with larger 'generic' issues (namely: that there are multiple roles that are 'generic' in Gecko currently). We'll sort that out in a later commit. This revision adds a new web platform test to verify that the generic role actually overrides an element's implicit role. Differential Revision: https://phabricator.services.mozilla.com/D200133 --- accessible/base/ARIAMap.cpp | 10 ++++++++ .../tests/wai-aria/role/generic-roles.html | 23 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 testing/web-platform/tests/wai-aria/role/generic-roles.html diff --git a/accessible/base/ARIAMap.cpp b/accessible/base/ARIAMap.cpp index 5f93a340ed2b..01cc5d041747 100644 --- a/accessible/base/ARIAMap.cpp +++ b/accessible/base/ARIAMap.cpp @@ -690,6 +690,16 @@ static const nsRoleMapEntry sWAIRoleMaps[] = { eLandmark, kNoReqStates }, + { // generic + nsGkAtoms::generic, + roles::SECTION, + kUseMapRole, + eNoValue, + eNoAction, + eNoLiveAttr, + kGenericAccType, + kNoReqStates + }, { // graphics-document nsGkAtoms::graphicsDocument, roles::NON_NATIVE_DOCUMENT, diff --git a/testing/web-platform/tests/wai-aria/role/generic-roles.html b/testing/web-platform/tests/wai-aria/role/generic-roles.html new file mode 100644 index 000000000000..9a67312dd8cf --- /dev/null +++ b/testing/web-platform/tests/wai-aria/role/generic-roles.html @@ -0,0 +1,23 @@ + + + + Generic Role Verification Tests + + + + + + + + + +

Tests generic.

+ +

x

+ + + + +