-
Notifications
You must be signed in to change notification settings - Fork 402
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
ARIA attributes should be allowed on SVG elements #846
Comments
The following code is from an xhtml file generating the error. The errors are arising from 3 attributes used in the img element. |
@tofi86 Not sure about that but it may well be SVG 1.1 (the one we use in the EPUB spec) versus SVG 2.0. Maybe that can help with the review. Aria attributes were added in SVG 2.0, they did not appear in SVG 1.1. As for Note 1.1 is somewhat painful in some cases e.g. custom |
The I could reproduce that this is still reported as an error on v4.2.0-beta. |
I added a test case in branch @mattgarrish can you please confirm that ARIA attributes should indeed be supported? (in light of w3c/epub-specs#1219) |
FWIW, as someone who spent an entire workday adding – do the right a11y thing – then removing ARIA attributes on hundreds of SVGs a few years ago, I’m highly in favour of supporting them (and there are so many how-tos using those irl that it’s kinda frustrating to discover they will create errors once it’s done). |
Right, let's not take the attributes out and get into a game of modifying the official schemas. The end resolution was that we'll sort of pretend we're referencing 1.1 for spec purity but the reality is we'll actually allow whatever the browsers are now accepting, which as @dauwhe pointed out in w3c/epub-specs#1219 (comment) is closer to SVG2. |
Just for clarifications: these attributes seem to be rejected by the new schemas in 4.2.0-beta. That is likely due to how we integrate these when validating as SVG-only, I'll have a deeper look. |
Seems to be working for me. There are elements that the attributes aren't allowed on, but I haven't seen them rejected. |
Have you tried the test case in branch |
No, I was using the sous le vent book from the samples and applying roles and attributes to various elements without problem. It must be a localized bug. |
It doesn't report Looking at the schema, wouldn't the ? at the end here be the culprit:
|
Sorry, that's from attlist.image in svg-image.rnc in case it's not obvious. |
You mean it should be |
For ref, here's the validator.nu commit which introduced it. |
I was thinking it was unnecessary, but that's probably not the issue after running a couple of tests. It also validates fine in the online validator, which presumably is using these same schemas. I'll keep sniffing around and see if I can make any sense of what is happening. |
For the record, we were missing this line from nu validator driver file:
So only the attributes defined in |
Add `aria.global` attributes to `SVG.Core.attrib`, in both SVG and XHTML integration schemas. Fix #846
I have been working on making an epub file accessible. Finally, the DAISY ACE showed no violations arising from the epub file after validation. On validating via the epubcheck 4.0.2 , I got 3 errors arising from parsing the epub file. The errors were as a result of making an image accessible:
1. Error while parsing file 'attribute "aria-label" not allowed here
2. Error while parsing file 'attribute "role" not allowed here, and
3. Error while parsing file 'attribute "alt" not allowed here
How can I solve this?
The text was updated successfully, but these errors were encountered: