Problem/Motivation
I created this issue as follow-up of #2467827: [META] W3C validation for Drupal Core.
Drupal core added a lot of WAI-ARIA roles to Drupal core (which is a good thing).
A WAI-ARIA role is needed when the markup itself isn't clear. But markup like is superfluous since the HTML elements themselves already explain their role. Having these (duplicate) attributes makes W3C validation fail and we don't want that.
Proposed resolution
Remove attribute Role='main' in tag main.
Files: install-page.html.twig, page.html.twig, maintenance-page.html.twig.
Themes to affect: System Theme, Stable Theme, Classy Theme, Bartik Theme, Seven Theme.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | Showing_results_for_contents_of_text-input_area_-_Nu_Html_Checker.png | 183.77 KB | joelpittet |
| #3 | remove_main_role-2862904-3.patch | 6.08 KB | Karmen |
| error_validation.png | 74.84 KB | nesta_ |
Comments
Comment #2
Karmen commentedComment #3
Karmen commentedRemoved ARIA role from all the files.
Comment #4
darius.restivan commentedAhoy! Fixed.
Comment #5
lauriiiThank you for working on cleaning up the markup! Unfortunately, the role attribute is still needed because the main element is not properly supported on IE 11 and below. We still support IE 9, 10 and 11 why we should keep the attributes in place.
Comment #6
nesta_ commentedLaurii In my humble opinion, we should not let Drupal get validation errors by a browser that does not follow the standard.
I will honestly re-open the task until the Core passes the W3C. It does not matter the device.
For IE to get a patch.
Comment #7
nesta_ commentedI test patch and is ok. Im too change to RTBC
Comment #8
nesta_ commentedadd tag-event :)
Comment #9
lauriiiThis issue needs an accessibility review since it affects accessibility on IE 9-11. Based on that we can make a decision if we should make this change or not.
Comment #10
lauriiiTagging also for accessibility
Comment #11
nesta_ commentedI'm still thinking. In case of IE or patch or leave one of the Themes with support for IE, the Core, Classy and Bartik is ugly to perform the test and find this type of failures. Say that we do to support IE when we work with patches I see a delay to potential.
It is one of the things that must always be changed in order to give customers the power of Drupal Base and validate it completely.
What I said is my humble opinion and we are here to help. If we think of a path that works well for everyone, we can work on it.
A hug!
Lauriii i miss you in devdaysseville!!, i hope see you in drupalcamp madrid!
Comment #12
cg433n commentedI am able to reproduce this on
8.4.xwith the Bartik theme.The
mainrole attribute is redundant.Patch #3 applies and works (I tested it on a live site).
I also noticed that other html5 elements also had redundant attributes:
We might want to expand the scope of this issue to include the other elements, or open a new issue for each one (I couldn't find any other issues like this in the queue).
Comment #13
joelpittetThis is not a major issue. These are warnings in the validation service, not errors. There are actual errors that should get follow-up issues see screenshot.
This is taken from simpletest.me with one article added to the homepage.
This may be worth fixing still but maybe should wait till we deprecate support for IE9/IE10 at least, consider postponing this issue on #2842298: [policy, no patch] Drop IE9 and IE10 support from Drupal 8.4.x and #2390621: [policy, no patch] Update Drupal's browser support policy
Comment #14
cilefen commentedI am giving cg433n credit for some of the triage work done. Going forward, you should know that we like to see documented triage steps (even if brief). It is the only way to know if the triage has actually been completed. Here are some made-up examples of documented triage steps:
Thank you!
Comment #15
andrewmacpherson commentedAs @lauriii noted, this is a problem with Internet Explorer (all versions). 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.
As @joelpittet notes, it produces validation warnings, 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" element is not included in landmark navigation without the explicit role attribute.
I propose we postpone this, until we are no longer supporting Internet Explorer.
Comment #16
andrewmacpherson commentedComment #17
andrewmacpherson commentedLet's close this in favour of #2655794: Remove redundant WAI-ARIA role attributes from <main>, <nav>, <aside>, <header>, and <footer> elements
This issue has more detailed analysis, but the other one has a more comprehensive patch already.
Comment #18
andrewmacpherson commentedComment #19
andrewmacpherson commentedTidying up the "needs accessibility review" list.
This issue should remain closed as a duplicate of #2655794: Remove redundant WAI-ARIA role attributes from <main>, <nav>, <aside>, <header>, and <footer> elements.