diff --git a/_drafts/SC2-4-4-link-has-name.md b/_drafts/SC2-4-4-link-has-name.md deleted file mode 100644 index aad8bc0950f..00000000000 --- a/_drafts/SC2-4-4-link-has-name.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -name: Links have an accessible name -description: | - Each link has an accessible name - -success_criterion: -- 4.1.2 # Name, Role, Value - -test_aspects: # Remove what is not applicable -- DOM Tree -- CSS Styling - -authors: -- Wilco Fiers -- Anne Thyme Nørregaard ---- - -## Test procedure - -### Applicability - -The rule applies to any HTML or SVG element with the semantic role of `link` that are [visible on the page][] or [exposed to assistive technologies][]. - -**Note**: Roles can be [implicit](https://www.w3.org/TR/html-aria/#dfn-implicit-aria-semantics) through the element name or explicit through the [role attribute](https://www.w3.org/TR/html52/dom.html#aria-role-attribute). - -### Expectation - -Each target element has an [accessible name][] that is [non-empty][] - -## Assumptions - -- The rule assumes that all links are user interface components as defined by WCAG 2. When the link role is used incorrectly, this assumption may not be true. - -## Accessibility Support - -There are no major accessibility support issues known for this rule. - -## Background - -- [https://www.w3.org/WAI/WCAG20/quickref/?showtechniques=244#navigation-mechanisms-refs](https://www.w3.org/WAI/WCAG20/quickref/?showtechniques=244#navigation-mechanisms-refs) -- [ARIA7: Using aria-labelledby for link purpose](https://www.w3.org/TR/WCAG20-TECHS/ARIA7.html) -- [ARIA8: Using aria-label for link purpose](https://www.w3.org/TR/WCAG20-TECHS/ARIA8.html) -- [F89: Failure of Success Criteria 2.4.4, 2.4.9 and 4.1.2 due to using null alt on an image where the image is the only content in a link](http://www.w3.org/TR/WCAG20-TECHS/F89.html) -- The WCAG 2.0 Techniques already contain examples and code snippets to illustrate which content passes or fails the test. Whenever possible auto-wcag refers to those. Another source for test cases is the W3C Before and After Demonstration. - -## Test Cases - -### Passed -```html - Web Accessibility Initiative (WAI) -``` - -```html - -``` - -### Failed - -```html -
-

- Some detailed article, but the link to read more is placed with no relevance to the text, thereby the link has lost context. -

-

- Read More... -

-
-``` - -```html - - - - - - - -
Song: Ed Sheeran - Galway Girl.
- - Download Now - -
-``` - -### Inapplicable -```html -Web Accessibility Initiative (WAI) -``` - ------- - -[non-empty]: ../pages/algorithms/non-empty.html -[accessible name]: ../pages/algorithms/accessible-name.html -[exposed to assistive technologies]: ../pages/algorithms/exposed-to-assistive-technologies.html -[visible on the page]: ../pages/algorithms/visible-on-the-page.html diff --git a/_rules/SC2-4-4-link-has-name.md b/_rules/SC2-4-4-link-has-name.md new file mode 100644 index 00000000000..329cdac0891 --- /dev/null +++ b/_rules/SC2-4-4-link-has-name.md @@ -0,0 +1,168 @@ +--- +name: Links have an accessible name +description: | + Each link has an accessible name + +success_criterion: +- 4.1.2 # Name, Role, Value +- 2.4.4 + +test_aspects: # Remove what is not applicable +- DOM Tree +- CSS Styling + +authors: +- Wilco Fiers +- Anne Thyme Nørregaard +--- + +## Test procedure + +### Applicability + +The rule applies to any HTML element with the [semantic role](#semantic-role) of `link` that is [visible on the page](#visible-on-the-page) or [exposed to assistive technologies](#exposed-to-assistive-technologies). + +### Expectation + +Each target element has an [accessible name](#accessible-name) that is [non-empty](#non-empty). + +## Assumptions + +- The rule assumes that all links are [user interface components](https://www.w3.org/TR/WCAG20/#user-interface-componentdef) as defined by WCAG 2. When the link role is used incorrectly, this assumption may not be true. + +## Accessibility Support + +There are no major accessibility support issues known for this rule. + +## Background + +- [https://www.w3.org/WAI/WCAG20/quickref/?showtechniques=244#navigation-mechanisms-refs](https://www.w3.org/WAI/WCAG20/quickref/?showtechniques=244#navigation-mechanisms-refs) +- [ARIA7: Using aria-labelledby for link purpose](https://www.w3.org/TR/WCAG20-TECHS/ARIA7.html) +- [ARIA8: Using aria-label for link purpose](https://www.w3.org/TR/WCAG20-TECHS/ARIA8.html) +- [F89: Failure of Success Criteria 2.4.4, 2.4.9 and 4.1.2 due to using null alt on an image where the image is the only content in a link](http://www.w3.org/TR/WCAG20-TECHS/F89.html) + +## Test Cases + +### Passed + +```html + + Web Accessibility Initiative (WAI) +``` + +```html + +
Web Accessibility Initiative (WAI)
+``` + +```html + + +``` + +```html + + +``` + +```html + + +``` + +```html + + +``` + +```html + +This is my link text +``` + +```html + + +
This is my link text
+``` + +```html + + + + + Web Accessibility Initiative (WAI) + + +``` + +```html + + +``` + +### Failed + +```html + + +``` + +```html + + +``` + +```html + + +``` + +```html + + +``` + +```html + + +
+``` + +```html + + +``` + +```html + + +``` + +```html + + +``` + +### Inapplicable + +```html + +Web Accessibility Initiative (WAI) +``` + +```html + + +``` + +```html + +Some text +```