forked from mirrors/gecko-dev
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
This commit is contained in:
parent
447963adb2
commit
5e6c99f2ed
2 changed files with 33 additions and 0 deletions
|
|
@ -690,6 +690,16 @@ static const nsRoleMapEntry sWAIRoleMaps[] = {
|
||||||
eLandmark,
|
eLandmark,
|
||||||
kNoReqStates
|
kNoReqStates
|
||||||
},
|
},
|
||||||
|
{ // generic
|
||||||
|
nsGkAtoms::generic,
|
||||||
|
roles::SECTION,
|
||||||
|
kUseMapRole,
|
||||||
|
eNoValue,
|
||||||
|
eNoAction,
|
||||||
|
eNoLiveAttr,
|
||||||
|
kGenericAccType,
|
||||||
|
kNoReqStates
|
||||||
|
},
|
||||||
{ // graphics-document
|
{ // graphics-document
|
||||||
nsGkAtoms::graphicsDocument,
|
nsGkAtoms::graphicsDocument,
|
||||||
roles::NON_NATIVE_DOCUMENT,
|
roles::NON_NATIVE_DOCUMENT,
|
||||||
|
|
|
||||||
23
testing/web-platform/tests/wai-aria/role/generic-roles.html
Normal file
23
testing/web-platform/tests/wai-aria/role/generic-roles.html
Normal file
|
|
@ -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>
|
||||||
Loading…
Reference in a new issue