-
Notifications
You must be signed in to change notification settings - Fork 791
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
Add support for SVG images #20
Comments
I remember looking into this a while ago; there did not seem to be a consensus as to the proper or recommended way to add alt-text to inline SVG images. Needs research and specification. |
@dylanb Can you define some requirements for this? Browser support is flaky and I didn't see a definite answer from the specifications. |
deferring until better browser support |
Looking for help to document what portions of the accessible name calculation work properly for svg images (both inline and referenced via a Platforms that need to be supported are:
|
http://www.stommepoes.nl/work/firefox_svg.html This is a bit special because it's using a sprite and they're not nested. Would be great if mobile users could test these (I don't own an Android nor an iThing). |
@StommePoes could you add a failing example to that page? There are two types we need:
|
Yes. |
This page has interesting data about support http://simplyaccessible.com/article/7-solutions-svgs/ |
Re that link ^ for Windows High Contrast, we've been avoiding inline fill colours and instead have set it that the SVGs fill in CSS equals "currentColor" and that it must have a parent wrapped around it with a set color: someAccessibleColor. When our text colours change on WHC settings, the SVG should follow suit. |
@StommePoes example pretty please... |
Of using currentColor? Sure. |
Southwest Airlines uses svg for images sometimes. See example in footer of the Southwest Cargo logo/link on www.southwest.com of /assets/images/globalnav/logos/swa_footer_logo_swa_cargo.svg |
@goodwitch That example clearly shows how SVG is currently not supported. I have created this variant of the code http://dylanb.github.io/SVG/southwest.html There are two almost identical markups - except in the one instance the In the case of the |
Good examples of SVG with notes on current support by browsers https://weboverhauls.github.io/demos/svg/ Thanks to @weboverhauls |
Paciello Group have a good article on this: The "ARIA enhanced SVG accessibility" method appears to have full browser/screen reader support: <svg xmlns=http://www.w3.org/2000/svg role="img" aria-labelledby="title desc">
<title id="title">Circle</title>
<desc id="desc">Large red circle with a black border</desc>
<circle role="presentation" cy="60" r="55" stroke="black" stroke-width="2"
fill="red" />
</svg> |
@jacksleight That example is exactly the same as one of the ones that @weboverhauls has on his test page that is shown not to work properly with VO |
@dylanb @weboverhauls Ah OK, my mistake. Saw the compatibility table on paciellogroup.com and assumed it was right (don't have a Windows box to test on currently). Never mind. |
Well, the example by @StommePoes is within a button element so results may vary, who knows! I'll need to add button use cases to my test page. |
OK, I have a Rule, and a dozen integration tests. The rule determines whether an SVG (e.g. inline or standalone) provides an alternative for the image as a whole. The checks pass if any of the following are true:
I have integration tests for these, and I am working them into the right shape. So,
|
@chaals in order to pass any rule, we must show that it passes markup that is "accessibility supported", to do this we have to validate that the same markup works in all the combinations listed here: https://github.com/dequelabs/axe-core/blob/develop/doc/accessibility-supported.md Have you validated that all of the above work in all these combinations? |
Not yet, since I am still working from memory of what actually works, and checking whether the rough approach seems OK before sinking a whole lot more time into it. When I next have some time I'll set up the tests properly (I has them, but I'm busy this week). |
FYI: Updated my test page with TalkBack/Chrome & latest NVDA/FFX https://weboverhauls.github.io/demos/svg/ |
@weboverhauls Why did you fail the VO with Chrome on this markup
For me it reads the alt attribute but gets the role wrong. I would count this as minimally passing on the alt text at least. Update: does not work on iOS with VoiceOver - could you add operating system to your test matrix? |
Can you check again Dylan? VO testing thus far is only on Safari 11. |
@weboverhauls sorry - check what? |
There should be no test results for VO with Chrome so far. |
are you testing VO on iOS? |
On OSX. Will work to add iOS and clarify OS. |
There is new work in the WAI-ARIA group that relates to this, we need to track support for this https://www.w3.org/TR/graphics-aria-1.0/ |
rule help infrastructure in place 1/27/2020 |
Release notes and rule content in place 2/03/2020 |
"svg-img-alt" rule checking the svg elements with role=graphics-document, role=img and role=graphics-symbol through ARIA label, the title attribute or by having a non-empty child title element. This rule limits the role-img-alt rule to elements in the HTML namespace to avoid overlap with the svg-img-alt rule. |
Hello, I have a related problem like the last message, the axe extension is returning error for nodes with |
Hi @devniel that role does not appear to be an authorable role. If I go by this list: https://www.w3.org/WAI/PF/aria/roles notice it's not listed. So I think it makes sense that aXe would complain; this doesn't look like a valid role --for web developers to use--.
If you want your SVGs to expose themselves as images to AT esp for (older) Safari, use |
Here's the |
While I've been quick to roll my eyes at developers complaining that "accessibility is hard", I'm absolutely willing to go to bat for developers who try to look up a list of roles only to miss completely that there are other lists of roles elsewhere that they would never have thought to go looking for. That whole "role" section appears to list all roles:
...with no mention of a separate "graphics roles" list. Not aXe's fault and not the place to complain about it, but it's pretty frustrating. |
We do not handle SVG images correctly at the moment, need to be able to calculate the accessible name correctly for inline SVG and report when not present.
The text was updated successfully, but these errors were encountered: