CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 78
New rule: Explicit role SVG image has accessible name (7d6734) #419
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
From RGAA https://disic.github.io/rgaa_referentiel_en/criteria.html#images
|
Reached out to @audreymaniez offline to better understand RGAA Test 1.2.4 |
Example uses of SVG: https://www.w3.org/WAI/tips/designing/ |
This comment has been minimized.
This comment has been minimized.
@Brynanders: This PT website (https://eportugal.gov.pt) are using SVG inline. Usually in links they are using something like [a][span]text[/span][svg][/svg][/a] |
Updated description Updated applicability
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Using ARIA to enhance SVG accessibility (an article of Paciello Group from 2013) |
We have made some tests too at Access42, it may help @Brynanders : https://tests.a11y.fr/svg.html |
Added test cases
In order for this rule to work it is important to understand the SVG Accessibility API Mappings as referred to in our definition of included in the accessibility tree. In particular you will likely want to review https://www.w3.org/TR/svg-aam-1.0/#exclude_elements and https://www.w3.org/TR/svg-aam-1.0/#include_elements before reviewing this rule. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open question that we had some difficulty with internally at @Siteimprove: Is it appropriate to make the rule apply to all <svg>
elements that are included in the accessibility tree regardless of their semantic role?
Final Call ends on October 23rd. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy that the various changes and comments I made have been resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small editorial changes.
(apart from the general issue in #976 which needs to be tackled separately and shouldn't stop this PR).
|
||
## Expectation | ||
|
||
Each target element has an [accessible name](#accessible-name) that is not only [whitespace](#whitespace). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: as per #976 it seems that every element has a (possibly empty) accessible name and that accessible name are never (or should never be) only whitespace (i.e. every applicable element should pass the rule).
Given that this is a general problem, I guess we should proceed with this rule and solve the problem once we have discussed the issue and reached a decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be addressed. Given that issue now has a PR that's in final call, this needs to be fixed before merging. Change "an [accessible name][] that is not only [whitespace][]
" to "an [accessible name][] is empty
."
I think it's reasonable to do this as an editorial change and not have it go through another final call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as per Passed Example 4 in https://github.com/act-rules/act-rules.github.io/pull/981/files#diff-e5855eef878bfc5e2ac47f8ae6846dc4
- Updated *Passed Example 2* removing the explicit role from the `svg` - Minor editorial changes
- Removed *Inapplicable Example 1* - Minor editorial change
|
||
```html | ||
<p>How many circles are there?</p> | ||
<svg xmlns="https://www.w3.org/2000/svg"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What w3c spec is being used to define the accessible name calculation for this SVG? From my reading of the note in:
https://www.w3.org/TR/svg-aam-1.0/#mapping_additional_nd
There are five ways too find the accessible name of an SVG:
- aria-labelledby
- aria-label
- a direct child title element
- xlink:title attribute on a link
- for text container elements, the text content
Unless there is something subtle I'm missing about a circle element with role=graphics-symbol, that doesn't count as a text container and none of the other methods apply, so the SVG does not have an accessible name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The svg
element doesn't. But given that it also doesn't have one of the required explicit roles, it is inapplicable for this rule.
The circle
element has one of the required explicit roles, thus is applicable; and has an accessible name given by the aria-label
, thus it passes the rule.
The example description is about why the circle
passes the rule, and says nothing about the svg
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, that makes more sense. So we are not testing the outer SVG element but just the inner circle element. I guess when I read the rule title saying an "…SVG image has accessible name", I thought all the tests were for the SVG element. Many of the test cases are for the SVG elements. Maybe this should be split up for SVG elements and children of SVG elements. Anyway, thanks for clarifying.
|
||
## Expectation | ||
|
||
Each target element has an [accessible name](#accessible-name) that is not only [whitespace](#whitespace). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be addressed. Given that issue now has a PR that's in final call, this needs to be fixed before merging. Change "an [accessible name][] that is not only [whitespace][]
" to "an [accessible name][] is empty
."
I think it's reasonable to do this as an editorial change and not have it go through another final call.
#419 (comment) Changed " that is not only whitespace" to "that is no empty"
Updated, please take another loo;
Updated test cases to align with #981
```html | ||
<p>How many circles are there?</p> | ||
<svg xmlns="https://www.w3.org/2000/svg" role="img"> | ||
<title></title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that this example does not have whitespace within the title element as per the description. It is identical code to Failed Example 3.
This check idea came from @jorgeponto on a WP1 meeting on Feb 4 hosted by @nitedog.
After much discussion between @WilcoFiers @Jym77 @Brynanders @annethyme @JKODU, @Brynanders and @Jym77 with input from @WilcoFiers suggest creating a rule that is both true to the spec and maps to an accessibility requirement (1.1.1) with the assumption that the use of an explicit roles represents a clear intent to convey meaning for elements that otherwise: