angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.27k stars 6.71k forks source link

W3C Errors for Angular material components #17374

Closed SadhuSa closed 4 years ago

SadhuSa commented 4 years ago

Hi,

In my project,we are using angular material component. When running the W3C Nu Validation check during testing many errors were found on webpage. To run the W3C Nu Validation Check:

  1. Copy the Source Code
  2. Navigate to https://validator.w3.org/nu/
  3. Select Text Input from the Check by dropdown
  4. Replace the pre-populated code by pasting in the code that you have copied
  5. Select the Check button

Once the initial check has completed, use HFP's customized version of the parsing bookmarklet to only see the errors that violate WCAG success criterion 4.1.1, which checks for the presence of well-formed HTML markup. For details on where to download and how to use the 4.1.1. Parsing Filter bookmarklet go to: https://alm.cgifederal.com/collaborate/display/HFP/Customization+of+4.1.1+Parsing+Filter

Sample Error: Error : Element div not allowed as child element of button in this context.

Auto-generated html code from angular-material components does violate w3c compliance.

i.e block elements can't be used as a child of inline elements.

As this code is auto-generated, can we handle/fix these errors?

Thanks,

What are you trying to do?

What are you trying to do?

What troubleshooting steps have you tried?

What are you seeing that does not match your expectations?

Reproduction

We can only help if we can reproduce the problem ourselves.

Use StackBlitz to demonstrate what you are trying to do: https://stackblitz.com/fork/components-issue

Steps to reproduce:

Environment

jelbourn commented 4 years ago

Producing perfectly validation-friendly DOM is quite far down on our priority list vs. fixing bugs and adding new features. As such, I don't think we'll ever get to a point where we address this.

angular-automatic-lock-bot[bot] commented 4 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.