Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Incorrect Reporting of: Duplicate id attribute value "" found on the web page. #201

Closed
mAAdhaTTah opened this issue Sep 29, 2017 · 3 comments
Assignees
Labels

Comments

@mAAdhaTTah
Copy link

mAAdhaTTah commented Sep 29, 2017

It appears we have some 3rd-party scripts that are injected additional scripts with an empty id attribute. They look like this in the devtools:

duplicate-id

HTML_CodeSniffer is reporting this as a duplicate id error.

@ironikart ironikart self-assigned this Oct 2, 2017
@ironikart ironikart added the Bug label Oct 2, 2017
@mAAdhaTTah
Copy link
Author

@ironikart Thanks for the fix. After some additional discussion, we're wondering if the id attribute of script tags should be checked at all, since they're not relevant for accessibility. Thoughts?

@ironikart
Copy link
Contributor

@mAAdhaTTah I think that even though most assistive technologies would ignore script tags the DOM spec still says it has to be unique in the document.

A use case may be JS apps that use script tags to store template data and referenced by id. The script tag lets the template content be hidden from assistive technologies, but the JS app turns the content into mounted DOM elements. A duplicate id here may indirectly cause accessibility issues.

It's a stretch, but the check is working now and we're just talking semantics not broken validation.

@mAAdhaTTah
Copy link
Author

Fair. The fix was merged so I'll close this. Thanks for your help!

dochne pushed a commit to silktide/HTML_CodeSniffer that referenced this issue Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants