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.

Differential Revision: https://phabricator.services.mozilla.com/D200133
This commit is contained in:
Nathan LaPre 2024-02-07 19:51:40 +00:00
Родитель f01fa3c6d9
Коммит 970d32d957
2 изменённых файлов: 33 добавлений и 0 удалений

Просмотреть файл

@ -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,

Просмотреть файл

@ -0,0 +1,23 @@
<!doctype html>
<html>
<head>
<title>Generic Role Verification Tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/wai-aria/scripts/aria-utils.js"></script>
</head>
<body>
<p>Tests <a href="https://w3c.github.io/aria/#generic">generic</a>.</p>
<p role="generic" data-testname="generic role on p element is generic" class="ex-generic">x</p>
<script>
AriaUtils.verifyGenericRolesBySelector(".ex-generic");
</script>
</body>
</html>