no-invalid-role.md

December 5, 2019 ยท View on GitHub

no-invalid-role

This rule checks for invalid element/role combinations.

Current list of checks:

  1. Use of the presentation role for content which should convey semantic information may prevent the user from understanding that content. This rule checks semantic HTML elements for the presence of role="none" or role="presentation" and compares it to the list of disallowed elements. It should not effect custom elements.

Examples

This rule forbids the following:

<table role="presentation">
</table>
<ul role="none">
</ul>

This rule allows the following:

<img role="presentation">
<span role="none"></span>

Migration

  • If violations are found, remediation should be planned to replace the semantic HTML with the div element. Additional CSS will likely be required.

References