Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
markup
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2016 at 20:26 UTC
Updated:
27 Feb 2026 at 19:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
BarisW commentedComment #3
mgiffordI do agree 100% with
Would like confirmation that all
<aside>arerole="complementary".and
<header>makesrole="banner"redundant.Thanks @BarisW
Comment #7
dimaro commentedThe latest patch no longer applies.
Reroll against 8.4.x
Comment #8
feyp commentedAnswering the questions from comment #3:
Regarding the
<aside>element, https://www.w3.org/TR/html5/sections.html#the-aside-element says:Regarding the
<header>element, https://www.w3.org/TR/html5/sections.html#the-header-element says:fwiw, the information about the default role of the
<main>element can be found here:https://www.w3.org/TR/html5/grouping-content.html#the-main-element
Comment #9
feyp commented@dimaro, thanks for the reroll. The patch applies and looks good for the most part. However, there is still a
in
core/themes/seven/js/mobile.install.es6.jsafter applying the patch. I guess that we need to remove the banner role for this query selector as well?Also, I'm changing the category to
markupsince I guess your reassignment of the issue to the ajax subsytem was by accident.Comment #10
pk188 commentedFixed #9.
Check once for it's correctness.
Comment #11
pk188 commentedInterdiff for last patch.
Comment #12
feyp commentedThanks for working on this @pk188. By looking at the interdiff, I see you're changing the query selector from
header[role="banner"]toheader[]. Unfortunately, the latter is not a valid query selector, so you'll get a SyntaxError: 'header[]' is not a valid selector. You need to remove the square brackets as well to make it work (see the change incore/themes/seven/js/mobile.install.jsfor an example). Would you like to submit an updated version of your patch?Comment #13
pk188 commentedThanks for reviewing.
Here is new patch.
Comment #14
andrewmacpherson commentedThanks for re-rolling and checking this patch everyone.
We need to postpone this change, until we stop supporting Internet Explorer.
The issue is that IE does not pass the implicit ARIA landmark role to the host OS accessibility APIs. It only passes the landmark role if it is made explicit via the role attribute.
The good news is that it is fixed in Edge now. Firefox, Chrome, Safari, and Opera have handled implicit roles correctly for a long time already. I don't expect it to ever be fixed in IE 11.
The redundant value for the role attribute produces validation warnings, but not errors. It's clear from the HTML5 rec that is permitted valid markup. The "Do not set" advice is on the assumption that browsers will set the implicit ARIA role (emphasis mine):
The point here is that Internet Explorer does not behave correctly. I've confirmed that users IE11 + NVDA screen reader will be adversely affected; the main/aside/header elements are not included in landmark navigation without the explicit role attribute.
Comment #15
andrewmacpherson commentedI marked #2862904: Remove unneeded role="main" attribute from <main> element as a duplicate of this issue. The patch here is more comprehensive.
Comment #16
dimaro commented@andrewmacpherson @FeyP I only tried to bump this since the WAI-ARIA topic is a general "problem". The parent issue #2467827: [META] W3C validation for Drupal Core says the following:
Regarding the above mentioned:
Perfect! Thanks :)
Comment #17
andrewmacpherson commentedComment #20
andrewmacpherson commentedBy my count we have at least 4 separate issues about this. I've been closing the others in favour of this one, which remains postponed until we drop IE support.
Updating the title to bring the nav & footer elements into scope here, because it's the same story for all of them. The implicit ARIA landmark roles have been mapped by all the browsers we support, except for IE.
Comment #21
pifagor commented+1
Comment #26
andrewmacpherson commentedComment #27
chi commentedComment #29
alisonReady for status + version (issue metadata) update, now that IE11 support is officially being dropped with Drupal 10, ya?
(🎉🎉🎉🎉🎉🎉🎉)
Comment #30
shaalLooks like it's time to revive this issue.
We should update Olivero and Claro templates as well.
Comment #31
nod_Comment #32
mherchelrelated #3117230: Remove redundant role="article" from <article> html tags
Comment #33
gauravvvv commentedRemoved redundant WAI-ARIA role attributes. Attached patch for 10.1.x. please review
Comment #35
akshay kashyap commentedHere is new patch.
Comment #36
akshay kashyap commentedComment #38
gauravvvv commentedFixed failed tests. Attached interdiff for same. please review
Comment #39
smustgrave commentedChanges for header and main look good
But title mentions footer and nav so I think the issue summary should be updated for what is being addressed
Also according to https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/co... if there are multiple asides aria-label may be neded Do not implement yet as could be wrong assumption
Comment #40
catchCopying over @andrewmcpherson's comment from #3117230-28: Remove redundant role="article" from <article> html tags
The webkit issue is https://developer.mozilla.org/en-US/docs/Web/HTML/Element/footer#accessi...
Comment #42
liam morlandComment #44
liam morlandI have opened a merge request with changes based on patch #38. The patch is old, so the code should be checked to see if there are any more attributes that need to be removed. Before doing this work, there should be agreement that this change should be made at this time or this issue should be postponed based on some criteria.
Comment #45
mherchelheck yeah. There were lots that were missed, I pushed a fix for that.
Will ping @mgifford in Slack to see if he can signoff on the implementation.
Comment #46
mgiffordGreat stuff. Looks great to me. Hopefully we can get it in before it's 10th anniversary – 24 Jan 2026 at 15:26 EST
Comment #47
liam morlandI made a small test update and they are now passing.
Comment #48
mherchelComment #49
liam morlandI have drafted a change record.
Comment #50
dcam commentedI wanted to review this as someone who finished writing a custom theme from scratch in the last year and had to remove some redundant roles.
The MR looks great and in the end it's just a bunch of small removals. I have no notes.
I did a search of Core for
@roleandrole=["']. The remaining instances are not duplications of default roles.What I'd personally like to see in the CR is a quick reference list of impacted templates. Here are some suggestions:
Comment #51
liam morlandI have added the template list to the change record.
Comment #52
dcam commentedYeah, that's good. Thank you. Now I know exactly what I need to go check in my themes. LGTM.
Comment #53
mherchelI updated the title, and added reasoning to the CR. Thanks!
Comment #55
longwaveWondering if we should be changing stable9 here? If someone is using stable9 and has CSS rules that include the role, this is a BC break for them. Even if this is considered a bug fix, I'm not sure we should be breaking stable9 in this way - it's only a redundancy and keeping it doesn't cause any actual issues that I can see.
Comment #56
mherchelGood point. We should check with a framework manager.
Comment #57
mherchelAsked in Slack at https://drupal.slack.com/archives/C0D5GJZ8B/p1770901027037749
Comment #58
bnjmnmGood call. These changes should not be made in Stable 9 as they could result in user-impacting regressions. While the changes here could be categorized as a bug fix as it might appease some html validators, it does not improve any user facing or assistive tech functionality and does not seem to justify disrupting the Stable theme promise.
Comment #59
dcam commentedNeeds work per #55 and #58.
Comment #60
mherchelEasy enough change! Stable9 changes are now reverted.
Comment #61
dcam commentedI verified that the changes to stable9 were reverted.
Comment #64
longwaveLet's do it. Not eligible for backport to 11.3.x just in case this breaks someone's CSS or JS somewhere.
Committed and pushed 3fd5767ae80 to main and 75a55279cc0 to 11.x. Thanks!
Also published the change record.