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

HTML Validator does not allow role="presentation" or role="none" on SVG elements #1828

Closed
jongund opened this issue Mar 23, 2021 · 5 comments

Comments

@jongund
Copy link
Contributor

jongund commented Mar 23, 2021

I am trying to add role="presentation" or role="none" to the SVG elements in the Slider Thermostat example in pull #1755, and I am getting html linting errors that these roles are not allowed on the SVG element:

Error: "file:/home/runner/work/aria-practices/aria-practices/examples/slider/slider-thermostat.html":58.13-58.84: error: Bad value “presentation” for attribute “role” on element “svg”.
Error: "file:/home/runner/work/aria-practices/aria-practices/examples/slider/slider-thermostat.html":81.13-81.83: error: Bad value “presentation” for attribute “role” on element “svg”.

The same error is generated for role=none on the SVG element.

@jongund jongund changed the title Validator does not allow role="presentation" or role="none" on SVG elements HTML Validator does not allow role="presentation" or role="none" on SVG elements Mar 23, 2021
@nschonni
Copy link
Contributor

I think the upstream bug is validator/validator#1096

@jongund
Copy link
Contributor Author

jongund commented Mar 23, 2021

@nschonni
How do we get this fix for role on SVG in our linter?

@nschonni
Copy link
Contributor

Errors/warnings can be suppressed in https://github.com/w3c/aria-practices/blob/main/.vnurc. I'd probably point to the upstream tracking bug as a comment or point to this issue and leave it open till the upstream is fixed

@jongund
Copy link
Contributor Author

jongund commented Mar 23, 2021

@nschonni
I tried to add something to the .vnurc file in my pull request, but that doesn't change the error:
bcbdeed

Sorry I am not familiar with the VNU validator configuration, who can add the regex statement to allow the role attribute on SVG elements and what file needs to be changed and in which branch?

@jongund
Copy link
Contributor Author

jongund commented Mar 23, 2021

@nschonni
Thank you for the help, that fixed it.

@jongund jongund closed this as completed Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants