chore: avoid warning for redundant roles for a tag without href

pull/11737/head
paoloricciuti 2 years ago
parent 90d2b78af2
commit 34ebe5fc39

@ -793,7 +793,9 @@ function check_element(node, state) {
if (
current_role === get_implicit_role(node.name, attribute_map) &&
// <ul role="list"> is ok because CSS list-style:none removes the semantics and this is a way to bring them back
!['ul', 'ol', 'li'].includes(node.name)
!['ul', 'ol', 'li'].includes(node.name) &&
// <a role="link" /> is ok because without href the a tag doesn't have a role of link
!(node.name === 'a' && !attribute_map.has('href'))
) {
w.a11y_no_redundant_roles(attribute, current_role);
}

Loading…
Cancel
Save