Problem/Motivation

Many clients, particularly administrations are paying attentions to following standards and may impose their site to be W3C compliant.
The purpose of this META is to determine whether Drupal Core should follow W3C and if yes, to list initiatives, issues and tools to make it happen.

Remaining tasks

  • Define if Drupal Core should follow W3C standards.
  • Identify helper tools that might help finding misvalidation.
  • Define where child-issues should be open per point / per page or per type.
  • Characterize where Drupal does comply W3C and open child-issues.
  • Fix child-issues.

Proposed resolution

As an helper tool, I have started to port W3C Validator module. You can use the 8.x-dev version to find out that Drupal Core does not validate W3C standards yet.
Currently, it does only :
- validate websites accessible through the internet
- validates node pages and admin pages (either as anonymous or registered user)
- display nymber of errors / warnings
- display what's wrong

User interface changes

None.

API changes

None.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because it does not seems expected to not validate W3C test.
Issue priority Major because this seems serious to me but does not break any functionnality.
Unfrozen changes Unfrozen because it only changes output markup not APIs
Prioritized changes The main goal of this issue is accessibility and standard respects.
Disruption None.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dom.’s picture

Priority: Normal » Major
Dom.’s picture

Issue tags: +W3C validation, +w3c, +frontend
Dom.’s picture

Issue summary: View changes
Dom.’s picture

Linking a preliminary result report made from the view of an admin user.

Cliff’s picture

Dom., do you know about the Drupal Accessibility Group? Ever since Drupal 6, we have been working to help developers make Drupal conform with the W3C's Authoring Tool Accessibility Guidelines (ATAG). To conform with ATAG 2.0 would mean that:

  • The administrative interface of Drupal conforms with WCAG 2.0. (We want it to conform at Level AA.) This means that Drupal is an accessible tool for anyone to use to develop websites, applications, or whatever else they feel they can build with it.
  • As people use Drupal to build stuff, it guides them as much as possible to do it in a way that makes whatever they build accessible. For example, consider this simple case:
    • A person working on a Drupal website loads an image to a page.
    • One field in the interface for loading the image prompts them to enter the correct alt attribute.
    • Three radio buttons under that field are labeled, respectively:
      • This image conveys information. (This button is the default selection.)
      • This image is decorative, not meaningful.
      • This image is being loaded to a library, not a Web page.
    • Next to the field is a link labeled "Help" or "Explain 'alt text'."
    • If the person clicks that link, they will learn:
      • Alt text mainly helps people with screen readers understand images.
      • If they leave the default button selected, they must complete this field with the word or phrase they expect a sighted person to think of when they see that image. The screen reader will announce those words when it encounters the image.
      • If they select the second button, the alt attribute of the image will be alt="", which tells screen readers not to even say that the image is there.
      • If they click the third button, they must complete this field with a description of the image so a person who is using a screen reader and wants to download an image from that library will know what they are downloading.
    • To upload the image, the person will have to have selected the right combination: Either the first or third bullets, with alt text, or the second bullet, with no alt text.
    • When they successfully finish the process, the confirmation message shows them the HTML resulting from their actions and describes for them the circumstances under which that HTML would be accessible.
  • The site administrator can control the options presented—for example, if this is a place where the image will always fall into one of the three categories, hide the radio buttons and give the corresponding support:
    • If this is a place where only meaningful images are to be added, prompt the user to enter the text replacement for the image into the field for the alt attribute.
    • If only decorative images are loaded with this interface, hide the whole dialog about alt text.
    • If the page is an image library, prompt the user to enter a short description of the image, and tell them that the purpose of this description is to let people who are blind know whether that image is what they're looking for.

The scenario I've described above is not necessarily the perfect result, but I hope you can see the general point. There is usually no way a content management system can tell why an image is being added, so it can't tell whether the alt attribute should be empty or populated. And even if the alt attribute is populated, the system can't be sure the person uploading the image entered appropriate wording.

But the system can help people understand that every image must have an alt attribute and what they should consider when they decide what wording will go into that attribute. So it can't ensure that a website built with Drupal is accessible, but it can ensure that people who use Drupal to build websites know what they can do to make their websites accessible.

We're working now to ensure that Drupal 8 conforms with ATAG as well as it can. And I must admit that I've been almost completely absent since the release of Drupal 7, but I'm returning. For the latest word on accessibility and Drupal, contact Mike Gifford (mgifford), our accessibility maintainer for Drupal 8, or Jesse Beach (jessebeach), another of the organizers of the Accessibility Group.

I am very glad to see that you are interested in making Drupal more accessible, Dom. You might also review the issues that are blocking the release of Drupal 8 to see which ones relate to accessibility and whether you can help with those particular issues. That's a place to make a huge difference.

Welcome!

Cliff’s picture

Dom., it looks like you've used an automated report of some sort to identify errors in Drupal core. Unfortunately, not all errors can be caught in an automated check, and not all errors reported by an automated check are necessarily errors.

We do have an Accessibility Team that reviews patches and other code that touch accessibility in some way. I've added two tags to this issue:

  • "Accessibility," because it's intended to make Drupal work better for people with disabilities.
  • "needs accessibility review," because as an accessibility issue it does need review by the Accessibility Team.

For better response to issues you create that are related to accessibility, please be sure to add these tags.

I'm glad you're eager to help us make Drupal an even more accessible development platform. Thanks for contributing!

Dom.’s picture

@Cliff: Thanks for this long post of explanations. I did join the Accessibility group to keep informed.
Also, regarding #6, I made the tests using a custom module that validates every page using the W3C validator (https://validator.w3.org/). This is needed as a requirment for some government websites.

mgifford’s picture

Just quickly wanted to add that the "needs accessibility review" tag isn't reviewed as much as the "accessibility" tag.

Also wanted to add that the W3C validator has flaws in it like all accessibility testers. Automated testing only goes so far and each has it's limitations & biases. They test for the low hanging fruit of WCAG for the most part. Things like alt tags which are easy to programmaticly determine.

I'm really happy though that you've set up https://www.drupal.org/project/w3c_validator though. Excellent job.

Dom.’s picture

@mgifford for #8 : I did w3c_validator version D8 for drupaldevdays Montpellier 2015 as part of both "Service Authenticator" and "Session leaks" critical issues back then (for testing and POC) and for to generate this META story report. I know this module is not (yet) perfect, but at least it made the job quickly enough to start the work on those issues during devdays.

mgifford’s picture

Thanks.. Hopefully we'll get you some help to fix up the module.

catch’s picture

Category: Bug report » Plan
Dom.’s picture

Issue summary: View changes
FileSize
281.75 KB

I finished a first 8.x-1.0 version which allows to validate the page to W3C even if the site is offline, which makes it easy to use it on a dev platform.
Anyway, it helps me found some new errors/warnings as per how D8 ships. To reproduce, enable W3C Validator and validate your pages at : /admin/reports/w3c_validator

mgifford’s picture

Thanks @Dom. not sure how many of those are accessibility issues vs best practices.

Certainly duplicating html5 & aria isn't good. Would be worth setting up a new issue to clean up the html in 8.1

BarisW’s picture

I added a follow-up to remove unneeded role="navigation" attributes: #2655764: Remove unneeded role="navigation" attribute from <nav> elements

BarisW’s picture

BarisW’s picture

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Dom.’s picture

W3C Validator module is available for 9.x and can now use local validator.
Adding a child issue: #3186821: Attribute “hreflang” not allowed on element “span” and “button” at this point

mgifford’s picture

Issue tags: +atag, +we4authors

@Dom. what does the W3C Validator provide that tools like HTMLaw? - https://www.drupal.org/project/htmlawed

Dom.’s picture

Hi @mgifford. I am sorry, I am not a native english, and I do not understand your question. Is your question about the difference between this module and htmlawed ?
W3C Validator module simply let's you validate any page (not juste a node) to w3cvalidator, just as you would manually to at this adresse : https://validator.w3.org/
It does not fix anything though.
On the other hand, htmlawed module seems to only work on text fields (since it is a text format filter) but corrects the faulty HTML.

That is if I understood properly the htmlawed module description because I never actually used it.

mgifford’s picture

Ok, this is fine @Dom. It sounds like ultimately they are are accomplishing similar things. Both are aspects of accessibility.

It would be great if we were scanning our sandbox environments to catch bugs that the validator finds.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.