Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant role attributes #4854

Merged
merged 4 commits into from
Mar 18, 2024
Merged

Remove redundant role attributes #4854

merged 4 commits into from
Mar 18, 2024

Conversation

querkmachine
Copy link
Member

@querkmachine querkmachine commented Mar 12, 2024

Closes #4708.

Changes

  • Removes role attributes in components and review app examples for each of the following:
    • banner role on header
    • contentinfo role on footer
    • main role on main
    • navigation role on nav
    • complementary role on aside
    • region role on section
    • article role on article
  • Removes component tests checking for the existence of these roles.
  • Updates the html-validate config to:
    • Remove the no-redundant-role rule override. This now defaults back to not allowing redundant role attributes.
    • Add an exception for the use of the group role on fieldset elements, which we're maintaining for assistive technology support.

@querkmachine querkmachine requested a review from a team March 12, 2024 11:02
@querkmachine querkmachine self-assigned this Mar 12, 2024
Copy link

github-actions bot commented Mar 12, 2024

📋 Stats

File sizes

File Size
dist/govuk-frontend-development.min.css 112.86 KiB
dist/govuk-frontend-development.min.js 39.44 KiB
packages/govuk-frontend/dist/govuk/all.bundle.js 81.25 KiB
packages/govuk-frontend/dist/govuk/all.bundle.mjs 76.31 KiB
packages/govuk-frontend/dist/govuk/all.mjs 3.86 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend-component.mjs 359 B
packages/govuk-frontend/dist/govuk/govuk-frontend.min.css 112.85 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend.min.js 39.42 KiB
packages/govuk-frontend/dist/govuk/i18n.mjs 5.55 KiB

Modules

File Size (bundled) Size (minified)
all.mjs 72.23 KiB 37.61 KiB
accordion.mjs 22.71 KiB 12.85 KiB
button.mjs 5.98 KiB 2.69 KiB
character-count.mjs 22.4 KiB 9.92 KiB
checkboxes.mjs 5.83 KiB 2.83 KiB
error-summary.mjs 7.89 KiB 3.46 KiB
exit-this-page.mjs 17.1 KiB 9.26 KiB
header.mjs 4.46 KiB 2.6 KiB
notification-banner.mjs 6.26 KiB 2.62 KiB
radios.mjs 4.83 KiB 2.38 KiB
skip-link.mjs 4.39 KiB 2.18 KiB
tabs.mjs 10.13 KiB 6.11 KiB

View stats and visualisations on the review app


Action run for 4bfd65d

Copy link

github-actions bot commented Mar 12, 2024

Rendered HTML changes to npm package

diff --git a/packages/govuk-frontend/dist/govuk/components/footer/template-default.html b/packages/govuk-frontend/dist/govuk/components/footer/template-default.html
index 582955b85..65bb751d4 100644
--- a/packages/govuk-frontend/dist/govuk/components/footer/template-default.html
+++ b/packages/govuk-frontend/dist/govuk/components/footer/template-default.html
@@ -1,4 +1,4 @@
-<footer class="govuk-footer" role="contentinfo">
+<footer class="govuk-footer">
   <div class="govuk-width-container">
     <div class="govuk-footer__meta">
       <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
diff --git a/packages/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html b/packages/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html
index 3cb309ed7..7fa3403ec 100644
--- a/packages/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html
+++ b/packages/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html
@@ -1,4 +1,4 @@
-<footer class="govuk-footer" role="contentinfo">
+<footer class="govuk-footer">
   <div class="govuk-width-container">
       <div class="govuk-footer__navigation">
           <div class="govuk-footer__section govuk-grid-column-two-thirds">
diff --git a/packages/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html b/packages/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html
index ed5357816..bec6295d7 100644
--- a/packages/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html
+++ b/packages/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html
@@ -1,4 +1,4 @@
-<footer class="govuk-footer" role="contentinfo">
+<footer class="govuk-footer">
   <div class="govuk-width-container">
       <div class="govuk-footer__navigation">
           <div class="govuk-footer__section govuk-grid-column-one-third">
diff --git a/packages/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html b/packages/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html
index 72b9ac098..27961eb16 100644
--- a/packages/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html
+++ b/packages/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html
@@ -1,4 +1,4 @@
-<footer class="govuk-footer" role="contentinfo">
+<footer class="govuk-footer">
   <div class="govuk-width-container">
     <div class="govuk-footer__meta">
       <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
diff --git a/packages/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html b/packages/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html
index 2108d36cc..196c4d85c 100644
--- a/packages/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html
+++ b/packages/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html
@@ -1,4 +1,4 @@
-<footer class="govuk-footer" role="contentinfo">
+<footer class="govuk-footer">
   <div class="govuk-width-container">
     <div class="govuk-footer__meta">
       <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
diff --git a/packages/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html b/packages/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html
index 41a2fe297..d85bba743 100644
--- a/packages/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html
+++ b/packages/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html
@@ -1,4 +1,4 @@
-<footer class="govuk-footer" role="contentinfo">
+<footer class="govuk-footer">
   <div class="govuk-width-container">
     <div class="govuk-footer__meta">
       <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
diff --git a/packages/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html b/packages/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html
index e42b73bef..9425c0775 100644
--- a/packages/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html
+++ b/packages/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html
@@ -1,4 +1,4 @@
-<footer class="govuk-footer" role="contentinfo">
+<footer class="govuk-footer">
   <div class="govuk-width-container">
       <div class="govuk-footer__navigation">
           <div class="govuk-footer__section govuk-grid-column-full">
diff --git a/packages/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html b/packages/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html
index cb7d94756..90a792721 100644
--- a/packages/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html
+++ b/packages/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html
@@ -1,4 +1,4 @@
-<footer class="govuk-footer" role="contentinfo">
+<footer class="govuk-footer">
   <div class="govuk-width-container">
       <div class="govuk-footer__navigation">
           <div class="govuk-footer__section govuk-grid-column-full">
diff --git a/packages/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html b/packages/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html
index 739b1a896..74b7c486d 100644
--- a/packages/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html
+++ b/packages/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html
@@ -1,4 +1,4 @@
-<footer class="govuk-footer" role="contentinfo">
+<footer class="govuk-footer">
   <div class="govuk-width-container">
     <div class="govuk-footer__meta">
       <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
diff --git a/packages/govuk-frontend/dist/govuk/components/footer/template-with-meta.html b/packages/govuk-frontend/dist/govuk/components/footer/template-with-meta.html
index 1f56de4de..1b8de9cfb 100644
--- a/packages/govuk-frontend/dist/govuk/components/footer/template-with-meta.html
+++ b/packages/govuk-frontend/dist/govuk/components/footer/template-with-meta.html
@@ -1,4 +1,4 @@
-<footer class="govuk-footer" role="contentinfo">
+<footer class="govuk-footer">
   <div class="govuk-width-container">
     <div class="govuk-footer__meta">
       <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
diff --git a/packages/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html b/packages/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html
index f27ea26ac..65437c945 100644
--- a/packages/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html
+++ b/packages/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html
@@ -1,4 +1,4 @@
-<footer class="govuk-footer" role="contentinfo">
+<footer class="govuk-footer">
   <div class="govuk-width-container">
       <div class="govuk-footer__navigation">
           <div class="govuk-footer__section govuk-grid-column-two-thirds">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-default.html b/packages/govuk-frontend/dist/govuk/components/header/template-default.html
index 0f54c230c..91ab515f4 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-default.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-default.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html b/packages/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html
index 1d5538fe9..41bc217b3 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-header__container--full-width">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-full-width.html b/packages/govuk-frontend/dist/govuk/components/header/template-full-width.html
index 6edc739c5..bbebb0f68 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-full-width.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-full-width.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-header__container--full-width">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html b/packages/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html
index d53c15888..75ad6abc2 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html b/packages/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html
index cc561930a..6a04c6b18 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-label.html b/packages/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-label.html
index ad604aa6c..be66d9450 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-label.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-label.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-text.html b/packages/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-text.html
index e026d9909..fef844ab2 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-text.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-text.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-with-custom-navigation-label.html b/packages/govuk-frontend/dist/govuk/components/header/template-with-custom-navigation-label.html
index b462869bd..c4e96ac14 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-with-custom-navigation-label.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-with-custom-navigation-label.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-with-large-navigation.html b/packages/govuk-frontend/dist/govuk/components/header/template-with-large-navigation.html
index 4efaf3733..6406765d3 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-with-large-navigation.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-with-large-navigation.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-with-navigation.html b/packages/govuk-frontend/dist/govuk/components/header/template-with-navigation.html
index 0012869b2..7863fa81e 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-with-navigation.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-with-navigation.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-with-product-name.html b/packages/govuk-frontend/dist/govuk/components/header/template-with-product-name.html
index b53572f42..0ee1f2818 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-with-product-name.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-with-product-name.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-with-service-name-and-navigation.html b/packages/govuk-frontend/dist/govuk/components/header/template-with-service-name-and-navigation.html
index 633accdb3..f2fc493ad 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-with-service-name-and-navigation.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-with-service-name-and-navigation.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-with-service-name-but-no-service-url.html b/packages/govuk-frontend/dist/govuk/components/header/template-with-service-name-but-no-service-url.html
index 2b96ef2a7..d460416a5 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-with-service-name-but-no-service-url.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-with-service-name-but-no-service-url.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-with-service-name.html b/packages/govuk-frontend/dist/govuk/components/header/template-with-service-name.html
index fc96ac974..f01029178 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-with-service-name.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-with-service-name.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/header/template-with-st-edwards-crown.html b/packages/govuk-frontend/dist/govuk/components/header/template-with-st-edwards-crown.html
index 88da1afde..24f79ac7b 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/template-with-st-edwards-crown.html
+++ b/packages/govuk-frontend/dist/govuk/components/header/template-with-st-edwards-crown.html
@@ -1,4 +1,4 @@
-<header class="govuk-header" role="banner" data-module="govuk-header">
+<header class="govuk-header" data-module="govuk-header">
   <div class="govuk-header__container govuk-width-container">
     <div class="govuk-header__logo">
       <a href="/" class="govuk-header__link govuk-header__link--homepage">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-default.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-default.html
index 183e4c70f..ab6535379 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-default.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-default.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination" role="navigation" aria-label="Pagination">
+<nav class="govuk-pagination" aria-label="Pagination">
   <div class="govuk-pagination__prev">
     <a class="govuk-link govuk-pagination__link" href="/previous" rel="prev">
       <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-first-page.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-first-page.html
index a6d690f35..9c6e6235a 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-first-page.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-first-page.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination" role="navigation" aria-label="Pagination">
+<nav class="govuk-pagination" aria-label="Pagination">
   <ul class="govuk-pagination__list">
     <li class="govuk-pagination__item govuk-pagination__item--current">
       <a class="govuk-link govuk-pagination__link" href="/page/1" aria-label="Page 1" aria-current="page">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-last-page.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-last-page.html
index 8e7daab39..c457fd460 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-last-page.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-last-page.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination" role="navigation" aria-label="Pagination">
+<nav class="govuk-pagination" aria-label="Pagination">
   <div class="govuk-pagination__prev">
     <a class="govuk-link govuk-pagination__link" href="/previous" rel="prev">
       <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-custom-accessible-labels-on-item-links.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-custom-accessible-labels-on-item-links.html
index 762546ab8..2c1a5951b 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-custom-accessible-labels-on-item-links.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-custom-accessible-labels-on-item-links.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination" role="navigation" aria-label="Pagination">
+<nav class="govuk-pagination" aria-label="Pagination">
   <div class="govuk-pagination__prev">
     <a class="govuk-link govuk-pagination__link" href="/previous" rel="prev">
       <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-custom-link-and-item-text.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-custom-link-and-item-text.html
index dc4d6cdcb..daa1fee26 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-custom-link-and-item-text.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-custom-link-and-item-text.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination" role="navigation" aria-label="Pagination">
+<nav class="govuk-pagination" aria-label="Pagination">
   <div class="govuk-pagination__prev">
     <a class="govuk-link govuk-pagination__link" href="/previous" rel="prev">
       <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-custom-navigation-landmark.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-custom-navigation-landmark.html
index 3fc7ebff8..fc0982962 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-custom-navigation-landmark.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-custom-navigation-landmark.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination" role="navigation" aria-label="search">
+<nav class="govuk-pagination" aria-label="search">
   <div class="govuk-pagination__prev">
     <a class="govuk-link govuk-pagination__link" href="/previous" rel="prev">
       <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html
index cbe4a7e24..10bddf90d 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination" role="navigation" aria-label="Pagination">
+<nav class="govuk-pagination" aria-label="Pagination">
   <div class="govuk-pagination__prev">
     <a class="govuk-link govuk-pagination__link" href="/previous" rel="prev">
       <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-next-only.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-next-only.html
index 16a56ff93..378b11e08 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-next-only.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-next-only.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination govuk-pagination--block" role="navigation" aria-label="Pagination">
+<nav class="govuk-pagination govuk-pagination--block" aria-label="Pagination">
   <div class="govuk-pagination__next">
     <a class="govuk-link govuk-pagination__link" href="/next" rel="next">
       <svg class="govuk-pagination__icon govuk-pagination__icon--next" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-labels.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-labels.html
index c5898f99c..ca2552c8c 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-labels.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-labels.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination govuk-pagination--block" role="navigation" aria-label="Pagination">
+<nav class="govuk-pagination govuk-pagination--block" aria-label="Pagination">
   <div class="govuk-pagination__prev">
     <a class="govuk-link govuk-pagination__link" href="/previous" rel="prev">
       <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-very-long-labels.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-very-long-labels.html
index d3862ed1e..c973e08b1 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-very-long-labels.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-very-long-labels.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination govuk-pagination--block" role="navigation" aria-label="Pagination">
+<nav class="govuk-pagination govuk-pagination--block" aria-label="Pagination">
   <div class="govuk-pagination__prev">
     <a class="govuk-link govuk-pagination__link" href="/previous" rel="prev">
       <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-in-a-different-language.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-in-a-different-language.html
index e764b7fdc..7636f4cec 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-in-a-different-language.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-in-a-different-language.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination govuk-pagination--block" role="navigation" aria-label="Pagination">
+<nav class="govuk-pagination govuk-pagination--block" aria-label="Pagination">
   <div class="govuk-pagination__prev">
     <a class="govuk-link govuk-pagination__link" href="/previous" rel="prev">
       <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only.html
index a89c77b7d..fcb3ec2b2 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination govuk-pagination--block" role="navigation" aria-label="Pagination">
+<nav class="govuk-pagination govuk-pagination--block" aria-label="Pagination">
   <div class="govuk-pagination__prev">
     <a class="govuk-link govuk-pagination__link" href="/previous" rel="prev">
       <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
diff --git a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-previous-only.html b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-previous-only.html
index 38c17cf22..1a3f74739 100644
--- a/packages/govuk-frontend/dist/govuk/components/pagination/template-with-previous-only.html
+++ b/packages/govuk-frontend/dist/govuk/components/pagination/template-with-previous-only.html
@@ -1,4 +1,4 @@
-<nav class="govuk-pagination govuk-pagination--block" role="navigation" aria-label="Pagination">
+<nav class="govuk-pagination govuk-pagination--block" aria-label="Pagination">
   <div class="govuk-pagination__prev">
     <a class="govuk-link govuk-pagination__link" href="/previous" rel="prev">
       <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">

Action run for 4bfd65d

Copy link

github-actions bot commented Mar 12, 2024

Other changes to npm package

The diff could not be posted as a comment. You can download it from the workflow artifacts.


Action run for 4bfd65d

These roles were included to help support older browsers that did not have the role implied by the HTML element.

As we no longer support those browsers in Frontend, we can get rid of our explicit role attributes on the following elements:

- the `banner` role on `header`
- the `contentinfo` role on `footer`
- the `main` role on `main`
- the `navigation` role on `nav`
- the `complementary` role on `aside`
- the `region` role on `section`
- the `article` role on `article`
Removes the `no-redundant-role` override. This now defaults to not allowing redundant `role` attributes.

Adds an exception for `fieldset`s with a `role` of `group`, which we're choosing to maintain for assistive technology support.
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4854 March 12, 2024 11:26 Inactive
@querkmachine querkmachine marked this pull request as ready for review March 12, 2024 11:51
Copy link
Contributor

@owenatgov owenatgov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By my eye you got them all. It feels a bit weird that there are now no tests for the default header but that's not a today problem.

@querkmachine querkmachine merged commit 24aeede into main Mar 18, 2024
46 checks passed
@querkmachine querkmachine deleted the remove-redundant-roles branch March 18, 2024 10:03
@36degrees 36degrees mentioned this pull request Mar 26, 2024
jrmhaig added a commit to ministryofjustice/Claim-for-Crown-Court-Defence that referenced this pull request Mar 27, 2024
See:
* https://github.com/alphagov/govuk-frontend/releases/tag/v5.3.0
* alphagov/govuk-frontend#4854

Note that the 'region' role has not been removed in the few places where it is
currently used as they are not in section tags.
owenatgov pushed a commit that referenced this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove redundant explicit role attributes from HTML5 elements
3 participants