-
Notifications
You must be signed in to change notification settings - Fork 79
New Rule: Links with identical accessible names serve equivalent purpose #220
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
New Rule: Links with identical accessible names serve equivalent purpose #220
Conversation
…e.md Updated test cases to involve scripted links
Test assets for PR #220
|
This looks very good. I will approve as soon as I can verify the test assets. |
|
|
||
| The rule applies to any two or more HTML or SVG elements that have the [semantic role](#semantic-role) of link, are [exposed to assistive technologies](#exposed-to-assistive-technologies) and that have the same [accessible name](#accessible-name). | ||
|
|
||
| **Note:** Leading and trailing whitespace and difference in case sensitivity should be ignored when deciding whether the [accessible names](#accessible-name) are the same. |
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 seems to be implementation detail and may be it is best if it lived within the definition of 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.
Put into seperate PR since other rules are also relying on the definition: #254
|
|
||
| ### Expectation | ||
|
|
||
| For each set of target elements, activating the links resolves, after any redirects, to resources that fulfil the same purpose in relation to the purpose indicated by the [accessible names](#accessible-name) of the link. |
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.
activating the links resolves is not simple to understand, also there are multiple breaks in this sentence.
How about:
Each target element resolves to resources .....
I believe resolve inherently tackles redirect
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.
Applicability rewritten and redirect guidance split out into a note.
| * contain different amounts of information and/or differently worded information | ||
| * are using different layouts. | ||
|
|
||
| **Note:** If the same content is presented in different formats, the format itself is often part of the link purpose, e.g. an article as both HTML and PDF. |
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.
if the format of the resulting page is different, the links would be ideally different, and can be ignored for the rule itself?
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.
With the direction this rule is taking, it should be evaluated if the purpose is actually the same...
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 don't really understand what is the purpose of this note, or how it would help interpret the rule
|
|
||
| ## Assumptions | ||
|
|
||
| * This rule assumes that the purpose of the links for links with identical link texts would not be ambiguous to users in general, which is the exception mentioned in the success criterion 2.4.9 Link Purpose (Link Only). |
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.
A link to SC2.4.9 in the background can be beneficial.
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.
There's already a link in the Background, but now also a link here
| @@ -0,0 +1,12 @@ | |||
| <!DOCTYPE html> | |||
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.
Ideally these file names are prefixed with the relevant SC, and not with in nested folders.
In this case, it could be
test-assets/SC2-4-9-rule-name-my-test-asset-file.html
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.
@JKODU, can we create some guidance on this? And maybe a clean-up... I just had a look in the folder and tried to copy what I saw.
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.
Thinking further about it, wouldn't it make sense that each rule had it's own folder for test assets, where the folder name is the same as the rule 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.
We reached a consensus on this in a previous meeting.
jeeyyy
left a comment
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.
See comments.
…e.md Addressing Jey's comments
Adding new paragraph on comparing acc names, that has so far been note in these rules: https://auto-wcag.github.io/auto-wcag/rules/SC2-5-3-label-content-name-mismatch.html #220 #251
We still need to discuss test assets, but can you review the rest again?
|
Test assets still missing, while waiting for decision on test asset folder structure and naming conventions. Please do review the rest in the meantime. |
|
Will you make a separate pull requests of the test assets later? I'll approve this. |
|
@nitedog please review |
|
|
||
| **Note:** If the same content is presented in different formats, the format itself is often part of the link purpose, e.g. an article as both HTML and PDF. | ||
|
|
||
| **Note:** If the [normalized](#url-normalisation) value of the ´href´ is identical, the resources are identical, thus fulfilling the same purpose. [Relative URLs](https://www.w3.org/TR/WD-html40-970917/htmlweb.html#relative-urls) first need to be resolved to full URLs before doing the comparison. |
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 is referring to a Working Draft of HTML4. Is there a comparable reference in HTML5?
|
|
||
| ## Assumptions | ||
|
|
||
| * This rule assumes that the purpose of the links for links with identical link texts would not be ambiguous to users in general, which is the exception mentioned in [Understanding Success Criterion 2.4.9: Link Purpose (Link Only)](https://www.w3.org/WAI/WCAG21/Understanding/link-purpose-link-only.html). |
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 recommend removing the second half of the sentence "which is the exception ...". The rule already refers to SC 2.4.9 which spells out this exception. Adding another link to the Understanding document is superfluous and also adds potential maintenance overhead.
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.
Separately from the above, is it usual to have such aspects of the requirement in the assumptions section? Seems a little odd to me. I would expect this to be part of this or another rule rather than as an assumption.
_rules/6cbcbe.md
Outdated
| Links created via scripting with explicit role of link, but leads to the same resource: | ||
|
|
||
| ```html | ||
| <span role="link" |
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 know that is not the point, but can we just add tabindex="0" to every span with role="link" :-)
Otherwise, the test case won't be keyboard usable (and since it's not the point of the test, I think it's a little damaging)
audreymaniez
left a comment
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 a great job, really well documented 👏
I'm just questionning the expectation about the instant redirection.
_rules/6cbcbe.md
Outdated
| ### Expectation | ||
|
|
||
| When followed, the links in each set of target elements resolve to the [same resource](#same-resource) or to [equivalent resources](#equivalent-purpose). | ||
| Resolving the links includes potential redirects, if the redirects happen instantly. |
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 interesting in understanding how a redirection that is not instant can impact the evaluation of how the ressources are the same or not ?
I see the discussion here, and I think it's fair on a user impact side, but i would failed the redirection itself with SC 3.2.5 not on link purpose.
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.
Continuing from that example, if /foo/b.html redirects to /foo/a.html after 10 seconds, a user would actually get to experience and possibly interact with /foo/b.html before being redirected to /foo/a.html. As such, /foo/b.html is experienced as distinct from /foo/a.html and the two are therefore clearly not the same resource. If, on the other hand, /foo/b.html redirects instantly to /foo/a.html, the two are experienced as the same resource, namely /foo/a.html.
I absolutely agree that such a delayed redirect should fail the WCAG, but that is not the concern of this rule. As you point out, it would also fail this rule which may or may not be appropriate; I don't know enough about the WCAG to have an opinion on that though.
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.
Thank you @kasperisager for the explanation.
@WilcoFiers your comments on putting it as a note means that the redirection is not to be tested within that rule?
|
|
||
| Non-identical resources can still be equivalent by equally complying to the expectation formed by the user when navigating to them, thus serving an equivalent purpose. This would usually involve that the advertised key content is the same. | ||
|
|
||
| Web pages and documents (e.g. PDFs, office formats etc.) may fulfil be equivalent resources, even if the resources: |
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.
There may be an extra word in this sentence, "may fulfil be equivalent resources".
carlosapaduarte
left a comment
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.
Amazing work @annethyme
Just some editorial changes remaining, I believe
_rules/6cbcbe.md
Outdated
|
|
||
| ### Applicability | ||
|
|
||
| This rule applies to any set of any two or more HTML or SVG elements that have the [semantic role](#semantic-role) of `link`, or a role that inherits from the `link` role, are [included in the accessibility tree](#included-in-the-accessibility-tree), and that have [matching](#matching-characters) [accessible names](#accessible-name) that does not only consist of [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.
does > do
_rules/6cbcbe.md
Outdated
|
|
||
| ## Assumptions | ||
|
|
||
| This rule assumes that the purpose of the links with identical names would not be ambiguous to users in general when seen in context on the web page, as users of assistive technologies in this case is not at a disadvantage when viewing the link out of context, e.g. on a list of links in a screen reader. |
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 second part of the sentence is not easy to read and understand. Since I'm not sure about what you meant, I'm not able to offer a suggestion :-(
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.
EDIT: nvm it is all cleared up now. Approved.
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.
From the Understanding document:
The Success Criterion includes an exception for links for which the purpose of the link cannot be determined from the information on the Web page. In this situation, the person with the disability is not at a disadvantage; there is no additional context available to understand the link purpose. However, whatever amount of context is available on the Web page that can be used to interpret the purpose of the link must be made available in the link text to satisfy the Success Criterion.
(https://www.w3.org/TR/UNDERSTANDING-WCAG20/navigation-mechanisms-link.html)
I will have another look at the wording asap.
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.
However that makes little sense because if they are not ambiguous when seen in context that doesn't mean that they are clear without context right?
I think the point here is that if I created a page with nothing but a link that reads "Click here", it is not an accessibility issue, and thus not a violation of success criterion 2.4.9, because it gives the same (poor) experience to everyone.
And I guess it doesn't just have to be a poor experience, but could also be game-like or artsy.
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.
@carlosapaduarte and @ShadowBB, I gave a shot at a rewrite. Please have a look again.
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.
Oh! I totally interpreted that the other way around.
You new writeup makes this a lot more clear and I agree with it wholeheartedly now! Nice work!
_rules/6cbcbe.md
Outdated
|
|
||
| #### Passed example 6 | ||
|
|
||
| Pages contain different amounts of information and/or differently worded information, but fulfils the same purpose in relation to the link: |
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.
fulfils > fulfil
_rules/6cbcbe.md
Outdated
|
|
||
| #### Passed example 8 | ||
|
|
||
| Links created via scripting with explicit role of link, but leads to the same resource: |
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.
leads > lead
_rules/6cbcbe.md
Outdated
|
|
||
| #### Failed example 3 | ||
|
|
||
| Links created via scripting with explicit role of link, but leads to different resources that offer different content: |
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.
leads > lead
Additionally, if you drop the first "different" it might improve readability
_rules/6cbcbe.md
Outdated
|
|
||
| #### Failed example 5 | ||
|
|
||
| A set of two SVG `<a>` elements have the same accessible name but links to different resources: |
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.
links > link
_rules/6cbcbe.md
Outdated
|
|
||
| #### Inapplicable example 2 | ||
|
|
||
| No identical link texts: |
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 about
Links with different accessible names
ShadowBB
left a comment
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 rule looks good apart from an unclear assumption. I am going to approve it because if the assumption means what I think it means it is technically correct but I would advise making it clearer.
_rules/6cbcbe.md
Outdated
|
|
||
| ## Assumptions | ||
|
|
||
| This rule assumes that the purpose of the links with identical names would not be ambiguous to users in general when seen in context on the web page, as users of assistive technologies in this case is not at a disadvantage when viewing the link out of context, e.g. on a list of links in a screen reader. |
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.
EDIT: nvm it is all cleared up now. Approved.
Changes implemented. Please review again.
carlosapaduarte
left a comment
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 assumption is now perfectly clear 👍
|
Sent out to the ACT Rules Community through public-act-r@w3.org:
|
| @@ -0,0 +1,280 @@ | |||
| --- | |||
| id: b20e66 | |||
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
_rules/6cbcbe.md
Outdated
| ### Expectation | ||
|
|
||
| When followed, the links in each set of target elements resolve to the [same resource](#same-resource) or to [equivalent resources](#equivalent-purpose). | ||
| Resolving the links includes potential redirects, if the redirects happen instantly. |
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 seems like it should be a note. Either add a new line between the two paragraphs, or put them on the same line.
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.
Removed the break between the two paragraphs. Is that enough to satisfy your feedback?
If we move it into a note, it will be informative, and it shouldn't be. It's part of what makes the expectation.
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.
In that case yeah, remove the line break. Either have something on the same line, or have an empty line between.
| * contain different amounts of information and/or differently worded information | ||
| * use different layouts. | ||
|
|
||
| If all resources cover the user's expectations created by e.g. the link name equally well, the resources are considered to be equivalent. |
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 don't think you can use "e.g." in the middle of a sentence like this. I think this sentence is a little confusing. I've tried to come up with an alternative, but I'm struggling even trying to understand what you are saying here. It sounds like whether or not something is an equivalent resource depends on the link to that resource? I'm not sure that's how it works.
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.
Moved the "e.g. the link name" into a note instead:
Note: The user's expectations for the resource can be formed by different things, e.g. the name of the link leading to the resource, with or without the context around the link. This depends on the accessibility requirement that is tested.
Does this work for you?
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.
LGTM
<< Describe the changes >>
Closes issue: #210
Reviewer checks
Required fields, to be filled out by PR reviewer(s)
Rule:orAlgorithm:orChore:based on work involved.How to Review And Approve