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
The sniff that generates the warning seems to be based on an overly broad interpretation of F92:
This failure occurs when a role of presentation is applied to an element whose purpose is to convey information or relationships in the content.
The example given is that a <table> element with role="presentation" no longer functions as a table. The important thing is the element itself, not its descendants. The WAI-ARIA spec specifically states that when you set role="presentation" on an element,
The roles, states, and properties of each descendant element remain visible to assistive technologies
I recommend that the sniff should be rewritten to apply more narrowly. At the very least, it should ignore elements like div and span that already have no semantic meaning, since setting role="presentation" on those elements has no effect on assistive technologies.
This came up previously as #191 in the context of <svg> elements. /cc @ironikart
The text was updated successfully, but these errors were encountered:
Thanks @TrevorBurnham. I'm marking this as a bug since I believe you are correct, the sniff is currently too broad and HTMLCS will show an error in cases where it isn't an actual failure. I'll look into improving this.
Prompted by mui/material-ui#18106
If you set
role="presentation"
on any container element whose descendants have a semantic meaning, you'll get the warning:For example, this markup triggers the warning:
The sniff that generates the warning seems to be based on an overly broad interpretation of F92:
The example given is that a
<table>
element withrole="presentation"
no longer functions as a table. The important thing is the element itself, not its descendants. The WAI-ARIA spec specifically states that when you setrole="presentation"
on an element,I recommend that the sniff should be rewritten to apply more narrowly. At the very least, it should ignore elements like
div
andspan
that already have no semantic meaning, since settingrole="presentation"
on those elements has no effect on assistive technologies.This came up previously as #191 in the context of
<svg>
elements. /cc @ironikartThe text was updated successfully, but these errors were encountered: