You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* These have constraints defined in aria-query's `elementRoles` which depend on knowledge of ancestor roles which we cant accurately determine in a linter context.
24
+
However, we benefit more from assuming the role, than assuming it's generic or undefined so we opt to hard code the mapping */
25
+
elementRolesMap.set({name: 'aside'},['complementary'])// `aside` still maps to `complementary` in https://www.w3.org/TR/html-aria/#docconformance.
26
+
elementRolesMap.set({name: 'li'},['listitem'])// `li` can be generic if it's not within a list but we would never want to render `li` outside of a list.
27
+
25
28
/*
26
29
Determine role of an element, based on its name and attributes.
30
+
We construct a key and look up the element's role in `elementRolesMap`.
31
+
If there is no match, we return undefined.
27
32
*/
28
33
functiongetRole(context,node){
29
34
// Early return if role is explicitly set
@@ -48,8 +53,7 @@ function getRole(context, node) {
0 commit comments