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.

Comments

nesta_ created an issue. See original summary.

Karmen’s picture

Assigned: Unassigned » Karmen
Karmen’s picture

Assigned: Karmen » Unassigned
Status: Active » Needs review
Issue tags: +drupaldevdays
StatusFileSize
new6.08 KB

Removed ARIA role from all the files.

darius.restivan’s picture

Status: Needs review » Reviewed & tested by the community

Ahoy! Fixed.

lauriii’s picture

Category: Bug report » Task
Status: Reviewed & tested by the community » Closed (won't fix)

Thank 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.

nesta_’s picture

Category: Task » Bug report
Priority: Normal » Major
Status: Closed (won't fix) » Needs review

Laurii 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.

nesta_’s picture

Status: Needs review » Reviewed & tested by the community

I test patch and is ok. Im too change to RTBC

nesta_’s picture

Issue tags: +DevDaysSeville

add tag-event :)

lauriii’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs accessibility review

This 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.

lauriii’s picture

Issue tags: +Accessibility

Tagging also for accessibility

nesta_’s picture

I'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!

cg433n’s picture

Issue tags: +Baltimore2017, +Triaged for D8 major current state

I am able to reproduce this on 8.4.x with the Bartik theme.

The main role 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:

* <header role="banner">
* <nav role="navigation">
* <aside role="complementary">

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).

joelpittet’s picture

Priority: Major » Normal
Status: Needs review » Needs work
Issue tags: -Triaged for D8 major current state
StatusFileSize
new183.77 KB

This 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

Results

cilefen’s picture

I 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:

  • I tested the steps to reproduce and they did (or did not) work (so I am tagging it "Needs issue summary update").
  • I searched for duplicate issues but could not find any.
  • I checked the issue summary and it is accurate and up-to-date.
  • Etc...

Thank you!

andrewmacpherson’s picture

Status: Needs work » Postponed

As @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):

In the majority of cases setting an ARIA role and/or aria-* attribute that matches the default implicit ARIA semantics is unnecessary and not recommended as these properties are already set by the browser. .

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.

andrewmacpherson’s picture

andrewmacpherson’s picture

Status: Postponed » Closed (duplicate)

Let'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.

andrewmacpherson’s picture

Tidying 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.