Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
1709582
Create SC2-4-9-links-with-identical-accessible-names-have-same-purpos…
Aug 20, 2018
33b71ec
Update SC2-4-9-links-with-identical-accessible-names-have-same-purpos…
Aug 20, 2018
1a071d1
Create index.html
Aug 20, 2018
f849efa
Update SC2-4-9-links-with-identical-accessible-names-have-same-purpos…
Sep 14, 2018
ab30e98
fix: Add new glossary - url normalisation
jeeyyy Sep 24, 2018
93df4f5
Editorial updates per feedback
Oct 3, 2018
7f7f62a
New "included in the accessbility tree" definition
Nov 20, 2018
1fc6ce8
Adding "non-empty" to acc. name in Applicability
Dec 11, 2018
0e69ff9
"are using" --> "use"
Dec 11, 2018
6271038
Linking to WHATWG instead of HTML4 draft
Jan 22, 2019
be8fe35
Referring to URL parsing instead of normalization
Jan 22, 2019
7781068
Removing notes to put into definition
Jan 22, 2019
2c66aab
Create equivalent-purpose.md
Jan 22, 2019
0b005b9
Removed notes that went into definition
Jan 22, 2019
6e2fa6e
Replaced with link to URL parsing
Jan 22, 2019
160193a
removed one more note
Jan 22, 2019
6245142
Added case-(in)sensitivity
Jan 22, 2019
dbfcac5
Removed case-sensitivity test case
Jan 22, 2019
6a59968
Added missing quotation marks in test case code
Jan 22, 2019
8d45d21
Changing filename to hex id
Jan 22, 2019
965631a
Create index.html
Jan 22, 2019
ebb1608
Create redirect.html
Jan 22, 2019
8893f03
Create index-copy.html
Jan 22, 2019
67a36ad
Create contact.html
Jan 22, 2019
6879e8a
Create contact.html
Jan 22, 2019
e3fe636
Create page1.html
Jan 22, 2019
bee8840
Create page2.html
Jan 22, 2019
503c19c
Create page3.html
Jan 22, 2019
dd11a8e
Create contact.html
Jan 22, 2019
63bc07c
Updated links in test cases
Jan 22, 2019
467d215
Update index-copy.html
Jan 22, 2019
4adeb0d
Delete index.html
Jan 22, 2019
496872d
Update redirect.html
Jan 22, 2019
a3e11a5
Update redirect.html
Jan 22, 2019
6acc56f
Update page1.html
Jan 22, 2019
6d75e1c
Update page2.html
Jan 22, 2019
d8f3972
Update page1.html
Jan 22, 2019
65fa6f6
Update page3.html
Jan 22, 2019
aa5f0d5
Update page3.html
Jan 22, 2019
804fe7a
More clarification to definition
Jan 29, 2019
af32ee8
Update contact.html
Jan 29, 2019
6d7299f
Update contact.html
Jan 29, 2019
0dfcdae
Create page4.html
Jan 29, 2019
20d5b67
Edited test cases
Jan 29, 2019
04314c2
Create contact.html
Jan 29, 2019
32cdcb4
Delete contact.html
Jan 29, 2019
e1140ae
Update 6cbcbe.md
Jan 29, 2019
4fc1956
Delete page4.html
Jan 29, 2019
ad4e40b
Update 6cbcbe.md
Jan 29, 2019
af0f5dc
Update 6cbcbe.md
Jan 29, 2019
bee70f5
Updated per Carlos' comments
Jan 29, 2019
e9875ca
Editorial
Feb 1, 2019
d284420
Update equivalent-purpose.md
Feb 1, 2019
073780e
Update 6cbcbe.md
Feb 1, 2019
e7dd836
Editorials
Feb 12, 2019
f231bbe
Create same-resource.md
Feb 12, 2019
6ad40c0
Remove stuff from new "same resources" definition
Feb 12, 2019
31227da
Expectation split out in two
Feb 12, 2019
b5f327f
Editorials: Terminology in test case descriptions
Feb 12, 2019
caa1cf9
Test case description clean up
Feb 12, 2019
bd803d8
Update test case
Feb 14, 2019
de93324
Taking into account redirects in user agents
Feb 28, 2019
e1fc64c
Sharpening test case description (Passed #5)
Feb 28, 2019
a2ad7f9
Applicability incl. roles that inherit from link
Mar 7, 2019
d97c325
Clarifying the assumption
Mar 7, 2019
bfd7052
Editorials per Carlos
Mar 7, 2019
9d1c29f
Editorials to clarify per Carlos' comments
Mar 7, 2019
822f48b
Added SVG test cases
Mar 7, 2019
54913d0
tabindex="-1" added to Inapplicable example 3
Mar 7, 2019
ae8ccf5
Create matching-text-content.md
Mar 12, 2019
d510fdc
Update matching-text-content.md
Mar 12, 2019
bfda52a
Update matching-text-content.md
Mar 12, 2019
c16eb3a
Using "matching text content" def. in appl.
Mar 12, 2019
2f9d2ca
"non-empty" updated to "that contain text content"
Mar 12, 2019
f63dc48
Update matching-text-content.md
Mar 14, 2019
5df0fd0
Clarifying: test target is a full set of elements
Mar 26, 2019
a9c0a69
Rename matching-text-content.md to matching-characters.md
Mar 26, 2019
fff5934
links activated --> links followed
Mar 27, 2019
7d2e1df
"applies to a set" --> "applies to any set..."
Mar 28, 2019
967fbf8
Specifying that redirect has to be instant to pass
Apr 5, 2019
fa65c98
Create redirect1.html
Apr 5, 2019
e25e4bc
Update 6cbcbe.md
Apr 5, 2019
950f48b
Remove note
Apr 10, 2019
30b96da
Update and rename equivalent-purpose.md to equivalent-resource.md
Apr 10, 2019
5060bcc
Update 6cbcbe.md
Apr 10, 2019
a945766
Update 6cbcbe.md
Apr 11, 2019
92ec5c9
tabindex="0" added to `span`s with role=link
Apr 23, 2019
0c92ddf
Editorial cleanup
Apr 29, 2019
95244c5
Test case descr.: "Link text" > "accessible name"
Apr 29, 2019
0f70f35
Grammar corrections and editorials
Apr 29, 2019
7898973
Update assumption for readability/understanding
Apr 29, 2019
694499b
Add id to frontmatter of rule
May 1, 2019
15a1c03
Update template to match new format
May 14, 2019
4fc8044
Removed new line in Expectation
May 14, 2019
fbc10f8
Moved example into a note
May 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
281 changes: 281 additions & 0 deletions _rules/6cbcbe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
---
id: b20e66

This comment was marked as resolved.

name: Links with identical accessible names serve equivalent purpose
rule_type: atomic

description: |
This rule checks that links with identical accessible names resolve to the same resource or equivalent resources.

accessibility_requirements:
wcag20:2.4.9: # Link Purpose (Link Only) (AAA)
forConformance: true
failed: not satisfied
passed: further testing needed
inapplicable: further testing needed

input_aspects:
- DOM Tree
- CSS Styling

authors:
- Anne Thyme Nørregaard
---

## 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 do not only consist of [whitespace](#whitespace).

**Note:** The test target for this rule is the full set of link elements that share the same [matching](#matching-characters) [accessible name](#accessible-name).

## 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.

## Assumptions

This rule assumes that the purpose of the links with identical accessible names would not be ambiguous to users in general when seen in context on the web page, which is the exception mentioned in success criterion [2.4.9 Link Purpose (Link Only)](https://www.w3.org/WAI/WCAG21/Understanding/link-purpose-link-only.html). If the links are ambiguous to users in general, users of assistive technologies are not at a disadvantage when viewing the links out of context, e.g. on a list of links in a screen reader, which makes it more of a general user experience concern than an accessibility issue.

## Accessibility support

There are no major accessibility support issues known for this rule.

## Background

- [Understanding Success Criterion 2.4.9: Link Purpose (Link Only)](https://www.w3.org/WAI/WCAG21/Understanding/link-purpose-link-only.html)
- [URL parsing](https://www.w3.org/TR/html52/infrastructure.html#parsing-urls)

## Test Cases

This comment was marked as resolved.

This comment was marked as resolved.


### Passed

#### Passed Example 1

A set of two HTML `<a>` elements have the same accessible name and link to the same resource.

```html
<a href="/test-assets/6cbcbe/index.html">Contact us</a>
<a href="/test-assets/6cbcbe/index.html">Contact us</a>
```

#### Passed Example 2

Links resolves to same resource after instant redirect:

```html
<a href="/test-assets/6cbcbe/index.html">Contact us</a>
<a href="/test-assets/6cbcbe/redirect.html">Contact us</a>
```

#### Passed Example 3

Resources are not the same, since the links resolve to different URLs, but the resources are completely identical, thus serving the same purpose:

```html
<a href="/test-assets/6cbcbe/index.html">Contact us</a>
<a href="/test-assets/6cbcbe/index-copy.html">Contact us</a>
```

#### Passed Example 4

Same link text used for links going to pages where the content section is the same, but where the navigation options (bread crumbs and local sub menus) differ due to different placement in navigation hierarchy:

```html
<a href="/test-assets/6cbcbe/about/contact.html">Contact us</a>
<a href="/test-assets/6cbcbe/careers/contact.html">Contact us</a>
```

#### Passed Example 5

URLs differ due to trailing slashes, but resolves to the same resource after redirects caused by user agent:

```html
<a href="/test-assets/6cbcbe/">Contact us</a>
<a href="/test-assets/6cbcbe">Contact us</a>
```

#### Passed Example 6

Pages contain different amounts of information and/or differently worded information, but fulfil the same purpose in relation to the link:

```html
<a href="/test-assets/6cbcbe/page1.html">Call us</a>
<a href="/test-assets/6cbcbe/page2.html">Call us</a>
```

#### Passed Example 7

Pages have the same advertised key content but use different layouts:

```html
<a href="/test-assets/6cbcbe/page1.html">Contact us</a>
<a href="/test-assets/6cbcbe/page3.html">Contact us</a>
```

#### Passed Example 8

Links created via scripting with explicit role of link, but lead to the same resource:

```html
<span role="link" tabindex="0"
onclick="location='/test-assets/6cbcbe/index.html'">
Link text
</span>

<span role="link" tabindex="0"
onclick="location='/test-assets/6cbcbe/index.html'">
Link text
</span>
```

#### Passed Example 9

A set of two SVG `<a>` elements have the same accessible name and link to the same resource.

```html
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<a href="http://facebook.com" aria-label="Follow us">
<circle cx="50" cy="40" r="35"/>
</a>

<a href="http://facebook.com">
<text x="50" y="90" text-anchor="middle">
Follow us
</text>
</a>
</svg>
```

### Failed

#### Failed Example 1

Same accessible name used for links going to different resources:

```html
<a href="http://facebook.com">Follow us</a>
<a href="http://twitter.com">Follow us</a>
```

#### Failed Example 2

Same accessible name used for links going to web pages that are similar, but have different information in their content:

```html
<a href="/test-assets/6cbcbe/about/contact.html">Contact us</a>
<a href="/test-assets/6cbcbe/admissions/contact.html">Contact us</a>
```

#### Failed Example 3

Links created via scripting with explicit role of link, but lead to resources that offer different content:

```html
<span role="link" tabindex="0"
onclick="location='/test-assets/6cbcbe/about/contact.html'">
Link text
</span>

<span role="link" tabindex="0"
onclick="location='/test-assets/6cbcbe/admissions/contact.html'">
Link text
</span>
```

#### Failed example 4

Same accessible name used for image links going to different resources:

```html
<a href="http://facebook.com"><img src="facebook.jpg" alt="Follow us" /></a>
<a href="http://twitter.com"><img src="twitter.jpg" alt="Follow us" /></a>
```

#### Failed Example 5

A set of two SVG `<a>` elements have the same accessible name but link to different resources:

```html
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<a href="http://facebook.com" aria-label="Follow us">
<circle cx="50" cy="40" r="35"/>
</a>

<a href="http://twitter.com">
<text x="50" y="90" text-anchor="middle">
Follow us
</text>
</a>
</svg>
```

#### Failed Example 6

Links resolves to same resource after redirect, but the redirect is not instant:

```html
<a href="/test-assets/6cbcbe/index.html">Contact us</a>
<a href="/test-assets/6cbcbe/redirect1.html">Contact us</a>
```

### Inapplicable

This comment was marked as resolved.


#### Inapplicable Example 1

´a´ and ´area´ elements without ´href´ attribute:

```html
<a>Link text</a>
<area aria-label="Link text">
```

#### Inapplicable Example 2

Links with different accessible names:

```html
<a href="/test-assets/6cbcbe/about/contact.html">Contact main office</a>
<a href="/test-assets/6cbcbe/admissions/contact.html">Contact admissions office</a>
```

#### Inapplicable Example 3

Link is not included in the accesssibility tree:

```html
<a href="/test-assets/6cbcbe/page1.html" aria-hidden="true" tabindex="-1">Contact Us</a>
<a href="/test-assets/6cbcbe/pabe2.html">Contact Us</a>
```

#### Inapplicable example 4

Links created via scripting, but without the semantic role of link:

```html
<span
onclick="location='/test-assets/6cbcbe/page1.html'">
Contact Us
</span>

<span
onclick="location='/test-assets/6cbcbe/page2.html'">
Contact Us
</span>
```

#### Inapplicable Example 5

Links do not have accessible names:

```html
<a href="http://facebook.com"></a>
<a href="http://twitter.com"></a>
```

#### Inapplicable Example 6

Image links do not have accessible names:

```html
<a href="http://facebook.com"><img src="facebook.jpg" /></a>
<a href="http://twitter.com"><img src="twitter.jpg" /></a>
```
18 changes: 18 additions & 0 deletions pages/algorithms/equivalent-resource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Equivalent resource
key: equivalent-resource
---

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 be equivalent resources, even if the resources:
* are located on different URLs, including different domains
* present different navigation options, e.g. through bread crumbs or local sub menus
* contain different amounts of information and/or differently worded information
* use different layouts.

If all resources cover the user's expectations equally well, the resources are considered to be equivalent.

**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.

**Note:** If the same content is presented in different formats or languages, the format or language itself is often part of the purpose of the content, e.g. an article as both HTML and PDF, an image in different sizes, or an article in two different languages. If getting the same content in different formats or languages is the purpose of having seperate links, the resources are not equivalent.
6 changes: 6 additions & 0 deletions pages/algorithms/matching-characters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Matching characters
key: matching-characters
---

A sequence of [characters](#character) is considered to match another if, after removing leading and trailing [space characters](https://www.w3.org/TR/html/infrastructure.html#space-characters) and replacing remaining occurrences of one or more space characters with a single space, the two sequences of characters are equal character-by-character, ignoring any differences in letter casing.
14 changes: 14 additions & 0 deletions pages/algorithms/same-resource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Same resource
key: same-resource
---

Two or more resources can be the same resource even though the URLs for them are different. This can be due to URL parsing, server settings, redirects and DNS aliasing.

If the [parsed URLs](https://www.w3.org/TR/html52/infrastructure.html#parsing-urls) for two resources are identical, the resources are the same resource.

Depending on the server, URLs can either be case-sensitive or case-insenstive, meaning that `<a href="page1.html">` and `<a href="Page1.html">` leads to either the same or two different pages.

Fully parsed URLs can be different, but still lead to the same resource after making the HTTP request, due to redirects and DNS aliasing. For example, these URLs are all fully normalised: http://example.com/, http://www.example.com/, https://www.example.com/. The server can however be configured to serve the same site for http and https, and the same site for example.com and www.example.com. This is common, but not guaranteed.

Some types of redirects are also caused by user agents, e.g. ensuring that http://example.com/ and http://example.com resolves to the same resource.
27 changes: 27 additions & 0 deletions test-assets/6cbcbe/about/contact.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>About - Contact</title>
</head>
<body>
<nav label="main menu" style="text-align: right;">
<a href="../about.html">About</a>
<a href="../admissions.html">Admissions</a>
<a href="../careers.html">Careers</a>
</nav>
<nav label="breadcrumb"><p>You are here: <a href="../about.html">About</a> / Contact us</p></nav>
<nav label="submenu" style="float:left">
<h2>About</h2>
<ul>
<li style="list-style-type: none;"><a href="history.html">History</a></li>
<li style="list-style-type: none;"><a href="employees.html">Employees</a></li>
<li style="list-style-type: none;"><a href="contact.html">Contact</a></li>
</ul>
</nav>
<main style="float:left; margin-left: 50px;">
<h1>Contact us</h1>
<p>Phone: (541) 754-3010</p>
<main>
</body>
</html>
27 changes: 27 additions & 0 deletions test-assets/6cbcbe/admissions/contact.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>About - Contact</title>
</head>
<body>
<nav label="main menu" style="text-align: right;">
<a href="../about.html">About</a>
<a href="../admissions.html">Admissions</a>
<a href="../careers.html">Careers</a>
</nav>
<nav label="breadcrumb"><p>You are here: <a href="../admissions.html">Admissions</a> / Contact</p></nav>
<nav label="submenu" style="float:left">
<h2>Admissions</h2>
<ul>
<li style="list-style-type: none;"><a href="positions.html">Visit</a></li>
<li style="list-style-type: none;"><a href="benefits.html">Dates</a></li>
<li style="list-style-type: none;"><a href="contact.html">Contact</a></li>
</ul>
</nav>
<main style="float:left; margin-left: 50px;">
<h1>Contact us</h1>
<p>Phone: (541) 754-3011</p>
<main>
</body>
</html>
Loading