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:
- 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"orrole="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
divelement. Additional CSS will likely be required.