govuk-frontend
govuk-frontend copied to clipboard
Remove redundant explicit role attributes from HTML5 elements
What
Remove the explicit role
attribute on HTML elements that have the same role implicitly, including:
- the
<header>
element in the Header component, which has abanner
role - the
<footer>
element in the Footer component, which has acontentinfo
role - the
<nav>
element in the Pagination component, which has anavigation
role
In some places we include an explicit group
role on <fieldset>
elements (e.g. the date input) to ensure that JAWS announces the accessible description – we should leave this in place unless we're able to do further investigation and understand whether this is still needed.
Update our HTML validation rules accordingly.
Why
These have historically been set because older browsers (noteably Internet Explorer) do not map these implicit roles correctly.
As our browser support model has evolved, we can now remove these implicit roles.
Who needs to work on this
Developers
Who needs to review this
Developers, Accessibility Specialist
Done when
- [ ] We are no longer adding redundant role attributes to elements that have the same implicit role (except
<fieldset>
) - [ ] HTML validation rules are updated to reflect this change