You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -38,21 +39,25 @@ This rule applies to any set of two or more [HTML or SVG elements][] for which a
38
39
- the elements are in the same [web page (HTML)][]; and
39
40
- the elements are [included in the accessibility tree][included in the accessibility tree]; and
40
41
- the elements have [matching][][accessible names][accessible name] that are not empty (`""`); and
41
-
- have the same [programmatically determined link context][].
42
+
-the elements have the same [programmatically determined link context][].
42
43
43
44
**Note:** The test target for this rule is the full set of link elements that share the same [matching][][accessible name][] and [programmatically determined link context][].
44
45
45
46
## Expectation
46
47
47
-
When followed, the links in each set of target elements resolve to the [same resource][] or to [equivalent resources](#equivalent-resource).
48
+
For each pair of links in each target set, one of the following is true:
49
+
50
+
- both links resolve to the [same resource][]; or
51
+
- both links resolve to [equivalent resources][equivalent resource]; or
52
+
- there is no visual information within the [web page][] to let users know that both links resolve to [non-equivalent resources][equivalent resource].
48
53
49
54
**Note**: Resolving the links includes potential redirects, if the redirects happen instantly.
50
55
51
56
## Assumptions
52
57
53
-
- This rule assumes thatthe purpose of the links with identical [accessible names][accessible name] and [context][programmatically determined link context] would not be ambiguous to users in general, which is the exception mentioned in [Success Criterion 2.4.4 Link Purpose (In Context)][sc244]. If the links are ambiguous to users in general, users of assistive technologies are not at a disadvantage when viewing the links, which makes it more of a general user experience concern than an accessibility issue.
54
-
- This rule assumes that, within the context of the test subject, the description provided by the [accessible name][] of a link can only accurately describe one resource (notably, homonyms alone are not used as link names). Thus, if two or more links have the same [accessible name][] but resolve to different resources, at least one of them does not describe its purpose.
55
-
- This rule assumes that assistive technologies are exposing all links on the page in the same way no matter which [document tree](https://dom.spec.whatwg.org/#document-trees) they are in. If an assistive technology requires the user to "enter" an `iframe` or a [shadow tree][] before exposing its links, then it is possible for two links to have identical name and same context but resolve to different resources without failing [Success Criterion 2.4.4 Link Purpose (In Context)][sc244] (if said links are in separate [documents][document] or [shadow trees][shadow tree])
58
+
- This rule assumes that, within the context of the test subject, the description provided by the [accessible name][] of a link can only accurately describe one resource (notably, homonyms alone are not used as link names). Thus, if two or more links have the same [accessible name][] but resolve to different resources, at least one of them does not accurately describe its purpose.
59
+
- This rule assumes that assistive technologies are exposing all links on the page in the same way no matter which [document tree](https://dom.spec.whatwg.org/#document-trees) they are in. If an assistive technology requires the user to "enter" an `iframe` or a [shadow tree][] before exposing its links, then it is possible for two links to have identical name and context but resolve to different resources without failing [Success Criterion 2.4.4 Link Purpose (In Context)][sc244] (if said links are in separate [documents][document] or [shadow trees][shadow tree]).
60
+
- This rule assumes that reading the URL, such as from the status bar when the link is focused, is not considered part of the context, and therefore, it does not disambiguate links.
56
61
57
62
## Accessibility Support
58
63
@@ -62,10 +67,15 @@ There are no accessibility support issues known.
62
67
63
68
There is a difference between two contexts being the _same_ and being _identical_. This rule specifically targets links within the _same_ context. The same context means exactly the same set of DOM nodes. Identical (but not the same) contexts might have a different set of DOM nodes, but those DOM nodes have equivalent content - such as text content, attribute values, and so on. This difference is similar to the difference in some programming languages between pointer equivalence and deep object equivalence. Links with identical name that are in identical (but not the same) contexts also fail [2.4.4 Link Purpose (In Context)][sc244]. However, defining "identical context" unambiguously has been deemed infeasible at this time, and so has been left out of this rule.
64
69
70
+
Links that are [ambiguous to users in general](https://www.w3.org/TR/WCAG22/#dfn-ambiguous-to-users-in-general) are covered by the exception mentioned in Success Criterion 2.4.4 Link Purpose (In Context). If the links are ambiguous to users in general, users of assistive technologies are not at a disadvantage when viewing the links, which makes it more of a general user experience concern than an accessibility issue.
71
+
72
+
Pages with links that are not [ambiguous to users in general][], but are ambiguous to some users are likely to fail [success criterion 1.3.1 Info and Relationships][sc131] if the disambiguation information is conveyed through presentation, but not semantically. Moreover, when this information is non-text content, such a page is likely to fail [success criterion 1.1.1 Non-text Content][sc111].
73
+
65
74
### Bibliography
66
75
67
76
-[Understanding Success Criterion 2.4.4: Link Purpose (In Context)](https://www.w3.org/WAI/WCAG22/Understanding/link-purpose-in-context.html)
-[Ambiguous to users in general](https://www.w3.org/TR/WCAG22/#dfn-ambiguous-to-users-in-general)
69
79
70
80
## Test Cases
71
81
@@ -207,11 +217,9 @@ These two SVG `a` and HTML `a` elements have the same [accessible name][], same
207
217
</html>
208
218
```
209
219
210
-
### Failed
211
-
212
-
#### Failed Example 1
220
+
#### Passed Example 9
213
221
214
-
These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context] but go to different resources.
222
+
These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context], but resolve to different resources. However, the purpose of these links is [ambiguous to users in general](https://www.w3.org/TR/WCAG22/#dfn-ambiguous-to-users-in-general). Thus all readers are unsure about the destination and the person with a disability is not at any disadvantage.
215
223
216
224
```html
217
225
<htmllang="en">
@@ -223,80 +231,149 @@ These two HTML `a` elements have the same [accessible name][] and [context][prog
223
231
</html>
224
232
```
225
233
234
+
### Failed
235
+
236
+
#### Failed Example 1
237
+
238
+
These two HTML `a` elements have the same [accessible name][] and are nested within the same [context][programmatically determined link context], but go to different resources.
239
+
240
+
```html
241
+
<htmllang="en">
242
+
<p>
243
+
To get in touch with us, you can either <ahref="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/contact-us.html?page=1">contact us</a> via chat or <ahref="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/contact-us.html?page=2">contact us</a> by phone.
244
+
</p>
245
+
</html>
246
+
```
247
+
226
248
#### Failed Example 2
227
249
228
-
These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context]. They link to web pages that are similar, but have different information in their content.
250
+
These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context], but go to different resources.
229
251
230
252
```html
231
253
<htmllang="en">
232
-
<div>
233
-
Learn more (<ahref="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/about/contact.html"
These two HTML `span` elements have an [explicit role][] of link, same [accessible name][] and [context][programmatically determined link context], but link to resources that offer different content.
263
+
These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context]. They are visually distinguishable thanks to the relationships conveyed through CSS, but go to different resources.
These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context], but go to different resources. Their purpose is disambiguated for sighted users by the alignment of the links with the images above.
These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context]. They link to web pages that are similar, but have different information in their content. Their purpose is disambiguated for sighted users by the alignment of the links with the images above.
These two HTML `span` elements have an [explicit role][] of link, same [accessible name][] and [context][programmatically determined link context], but link to resources that offer different content. Their purpose is disambiguated for sighted users by the alignment of the links with the images above.
These two HTML `a` elements with the same [accessible name][] and [context][programmatically determined link context] resolve to the [same resource][] after redirect, but the redirect is not instant.
290
364
291
365
```html
292
366
<htmllang="en">
293
367
<p>
294
-
Learn more (<ahref="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/index.html"
@@ -392,8 +469,23 @@ These two HTML `a` elements have the same [accessible name][] but different [pro
392
469
<div><ahref="https://www.w3.org/International/">Read more</a> about the W3C internationalization</div>
393
470
```
394
471
472
+
#### Inapplicable Example 7
473
+
474
+
These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context], but the second one is not [included in the accessibility tree][included in the accessibility tree].
0 commit comments