This is an accessibility issue picked up by our automated scanner. According to the following page, the role="navigation" is not allowed in a nav element.
https://www.w3.org/TR/html-aria/

This issue is currently present in the Seven, Classy and Stable themes in various places.

Comments

spencer95 created an issue. See original summary.

andrewmacpherson’s picture

Thanks for reporting this @spencer95. This has been reported several times, so I'll close it as a duplicate of #2655794: Remove redundant WAI-ARIA role attributes from <main>, <nav>, <aside>, <header>, and <footer> elements.

For the time being, we need to keep the redundant role="navigation" attribute. While the HTML5 and ARIA-in-HTML documents recommend not setting it, that's on the assumption that browsers will pass the implicit ARIA role semantic to OS-level accessibility APIs. Most up to date browsers do this correctly. From the ARIA-in-HTML working draft (13th Oct 2017):

Setting an ARIA role and/or aria-* attribute that matches the implicit ARIA semantics is unnecessary and is NOT RECOMMENDED as these properties are already set by the browser.

The problem is, IE11 doesn't do this. It only works if an explicit role="navigation" is present. Without this, users of IE11 and NVDA screen reader will not be able to identify navigation landmark regions.

It's fixed in MS Edge, but I don't expect it will ever be fixed in IE11. So we need to keep it around until Drupal core stops supporting IE11. It is valid HTML5 though, and the W3C validator reports it as a warning (not an error).

Further reading:

andrewmacpherson’s picture

Title: Invalid attribute role="navigation" in Stable/Classy/Seven theme's pager.html.twig » Redundant attribute role="navigation" in Stable/Classy/Seven theme's pager.html.twig

Clarifying the title. It's not invalid HTML if role=navigation is present, it's just redundant. The W3C HTML validator produces a warning, not an error.