govuk-frontend icon indicating copy to clipboard operation
govuk-frontend copied to clipboard

Remove redundant explicit role attributes from HTML5 elements

Open 36degrees opened this issue 1 year ago • 0 comments

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 a banner role
  • the <footer> element in the Footer component, which has a contentinfo role
  • the <nav> element in the Pagination component, which has a navigation 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

36degrees avatar Jan 31 '24 17:01 36degrees