-
Notifications
You must be signed in to change notification settings - Fork 83
Consider accessible description in the rules that use link context (5effbb, fd3a94) #1845
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
base: develop
Are you sure you want to change the base?
Changes from 22 commits
1746bf8
2d271ab
0b07c9d
3bf682f
1f6fcd2
1918c30
bc72adf
0a576aa
637c43c
8df5b30
b52c6f3
8b23479
16dfe6b
7986cd1
6b141c4
a7f9cec
29c31b0
1bd8c51
91fb0bc
4870c48
b32d0b6
d1d7cfe
3ff697a
47f5b1a
b664ffb
6260db4
618edff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -38,9 +38,10 @@ This rule applies to any set of two or more [HTML or SVG elements][] for which a | |||||
| - the elements are in the same [web page (HTML)][]; and | ||||||
| - the elements are [included in the accessibility tree][included in the accessibility tree]; and | ||||||
| - the elements have [matching][] [accessible names][accessible name] that are not empty (`""`); and | ||||||
| - the elements have [matching][] [accessible descriptions][accessible description]; and | ||||||
| - have the same [programmatically determined link context][]. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
consistent with bullets above |
||||||
|
|
||||||
| **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][]. | ||||||
| **Note:** The test target for this rule is the full set of link elements that share the same [matching][] [accessible name][], [accessible description][] and [programmatically determined link context][]. | ||||||
|
|
||||||
| ## Expectation | ||||||
|
|
||||||
|
|
@@ -73,7 +74,7 @@ There is a difference between two contexts being the _same_ and being _identical | |||||
|
|
||||||
| #### Passed Example 1 | ||||||
|
|
||||||
| These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context] and link to the [same resource][]. | ||||||
| These two HTML `a` elements have the same non-empty [accessible name][], empty [accessible description][], the same [context][programmatically determined link context], and resolve to the [same resource][]. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these texts are gettin pretty verbose. Not a blocker if people prefer this language, but I would suggest this:
Suggested change
The same for other example descriptions. |
||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -87,7 +88,7 @@ These two HTML `a` elements have the same [accessible name][] and [context][prog | |||||
|
|
||||||
| #### Passed Example 2 | ||||||
|
|
||||||
| These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context], and resolve to the [same resource][] after an instant redirect. | ||||||
| These two HTML `a` elements have the same non-empty [accessible name][], empty [accessible description][], the same [context][programmatically determined link context], and resolve to the [same resource][] after an instant redirect. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -102,7 +103,7 @@ These two HTML `a` elements have the same [accessible name][] and [context][prog | |||||
|
|
||||||
| #### Passed Example 3 | ||||||
|
|
||||||
| These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context], and resolve to identical resources. | ||||||
| These two HTML `a` elements have the same non-empty [accessible name][], empty [accessible description][], the same [context][programmatically determined link context], and resolve to identical resources. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -118,7 +119,7 @@ These two HTML `a` elements have the same [accessible name][] and [context][prog | |||||
|
|
||||||
| #### Passed Example 4 | ||||||
|
|
||||||
| These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context], and resolve to pages that serve the same purpose because the content section is the same. | ||||||
| These two HTML `a` elements have the same [accessible name][], empty [accessible description][], the same [context][programmatically determined link context], and resolve to pages that serve the same purpose because the content section is the same. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -134,7 +135,7 @@ These two HTML `a` elements have the same [accessible name][] and [context][prog | |||||
|
|
||||||
| #### Passed Example 5 | ||||||
|
|
||||||
| These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context], and go to pages that fulfill the same purpose in relation to the link because they contain the same relevant information. | ||||||
| These two HTML `a` elements have the same [accessible name][], empty [accessible description][], the same [context][programmatically determined link context], and go to pages that fulfill the same purpose in relation to the link because they contain the same relevant information. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -149,7 +150,7 @@ These two HTML `a` elements have the same [accessible name][] and [context][prog | |||||
|
|
||||||
| #### Passed Example 6 | ||||||
|
|
||||||
| These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context], and go to pages that use different layouts but have the same purpose. | ||||||
| These two HTML `a` elements have the same [accessible name][], empty [accessible description][], the same [context][programmatically determined link context], and go to pages that use different layouts but have the same purpose. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -165,7 +166,7 @@ These two HTML `a` elements have the same [accessible name][] and [context][prog | |||||
|
|
||||||
| #### Passed Example 7 | ||||||
|
|
||||||
| These two HTML `span` elements have an [explicit role][] of link, the same [accessible name][], the same [context][programmatically determined link context], and link to the [same resource][]. | ||||||
| These two HTML `span` elements have an [explicit role][] of link, the same [accessible name][], empty [accessible description][], the same [context][programmatically determined link context], and link to the [same resource][]. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -191,7 +192,7 @@ These two HTML `span` elements have an [explicit role][] of link, the same [acce | |||||
|
|
||||||
| #### Passed Example 8 | ||||||
|
|
||||||
| These two SVG `a` and HTML `a` elements have the same [accessible name][], same [context][programmatically determined link context] and link to the [same resource][]. | ||||||
| These two SVG `a` and HTML `a` elements have the same [accessible name][], empty [accessible description][], same [context][programmatically determined link context] and link to the [same resource][]. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -211,7 +212,7 @@ These two SVG `a` and HTML `a` elements have the same [accessible name][], same | |||||
|
|
||||||
| #### Failed Example 1 | ||||||
|
|
||||||
| These two HTML `a` elements have the same [accessible name][] and [context][programmatically determined link context] but go to different resources. | ||||||
| These two HTML `a` elements have the same [accessible name][], the same [accessible description][], and the same [context][programmatically determined link context], but go to different resources. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -225,7 +226,7 @@ These two HTML `a` elements have the same [accessible name][] and [context][prog | |||||
|
|
||||||
| #### Failed Example 2 | ||||||
|
|
||||||
| 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. | ||||||
| These two HTML `a` elements have the same [accessible name][], the same [accessible description][] and [context][programmatically determined link context]. They link to web pages that are similar, but have different information in their content. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -242,7 +243,7 @@ These two HTML `a` elements have the same [accessible name][] and [context][prog | |||||
|
|
||||||
| #### Failed Example 3 | ||||||
|
|
||||||
| 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. | ||||||
| These two HTML `span` elements have an [explicit role][] of link, the same [accessible name][], the same [accessible description][], and the same [context][programmatically determined link context], but link to resources that offer different content. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -264,7 +265,7 @@ These two HTML `span` elements have an [explicit role][] of link, same [accessib | |||||
|
|
||||||
| #### Failed Example 4 | ||||||
|
|
||||||
| These two SVG `a` elements have the same [accessible name][] and [context][programmatically determined link context] but link to different resources. | ||||||
| These two SVG `a` elements have the same [accessible name][], the same [accessible description][], and the same [context][programmatically determined link context], but link to different resources. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -286,7 +287,7 @@ These two SVG `a` elements have the same [accessible name][] and [context][progr | |||||
|
|
||||||
| #### Failed Example 5 | ||||||
|
|
||||||
| 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. | ||||||
| These two HTML `a` elements with the same [accessible name][], the same [accessible description][], and the same [context][programmatically determined link context], resolve to the [same resource][] after redirect, but the redirect is not instant. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -331,7 +332,28 @@ These two HTML `a` elements have different [accessible names][accessible name]. | |||||
|
|
||||||
| #### Inapplicable Example 3 | ||||||
|
|
||||||
| These two HTML `a` elements have the same [accessible name][] and link to the [same resource][] but different [programmatically determined link contexts][programmatically determined link context]. | ||||||
| These two HTML `a` elements have the same [accessible names][accessible name] but different [accessible descriptions][accessible description]. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
| <p> | ||||||
| <a | ||||||
| href="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/about/contact.html" | ||||||
| title="To learn more about us" | ||||||
| >Contact</a | ||||||
| > | ||||||
| <a | ||||||
| href="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/about/contact.html" | ||||||
| title="To know how to reach us" | ||||||
| >Contact</a | ||||||
| > | ||||||
| </p> | ||||||
| </html> | ||||||
| ``` | ||||||
|
|
||||||
| #### Inapplicable Example 4 | ||||||
|
|
||||||
| These two HTML `a` elements have the same [accessible name][], , the same [accessible description][], and link to the [same resource][] but different [programmatically determined link contexts][programmatically determined link context]. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -348,7 +370,7 @@ These two HTML `a` elements have the same [accessible name][] and link to the [s | |||||
| </html> | ||||||
| ``` | ||||||
|
|
||||||
| #### Inapplicable Example 4 | ||||||
| #### Inapplicable Example 5 | ||||||
|
|
||||||
| These two `span` elements do not have a [semantic role][] of link. | ||||||
|
|
||||||
|
|
@@ -366,9 +388,9 @@ These two `span` elements do not have a [semantic role][] of link. | |||||
| </html> | ||||||
| ``` | ||||||
|
|
||||||
| #### Inapplicable Example 5 | ||||||
| #### Inapplicable Example 6 | ||||||
|
|
||||||
| These two HTML `a` elements have the same [accessible name][] and link to the [same resource][] but different [programmatically determined link contexts][programmatically determined link context]. Even though the two contexts in this example are _identical_, they are not the _same_. That is: even though they have equivalent content, they do not consist of the same DOM elements. | ||||||
| These two HTML `a` elements have the same [accessible name][], the same [accessible description][], and link to the [same resource][] but different [programmatically determined link contexts][programmatically determined link context]. Even though the two contexts in this example are *identical*, they are not the *same*. That is: even though they have equivalent content, they do not consist of the same DOM elements. | ||||||
|
|
||||||
| ```html | ||||||
| <html lang="en"> | ||||||
|
|
@@ -383,16 +405,17 @@ These two HTML `a` elements have the same [accessible name][] and link to the [s | |||||
| </html> | ||||||
| ``` | ||||||
|
|
||||||
| #### Inapplicable Example 6 | ||||||
| #### Inapplicable Example 7 | ||||||
|
|
||||||
| These two HTML `a` elements have the same [accessible name][] but different [programmatically determined link contexts][programmatically determined link context] because the `div` elements place them in different display blocks. | ||||||
| These two HTML `a` elements have the same [accessible name][], the same [accessible description][], but different [programmatically determined link contexts][programmatically determined link context] because the `div` elements place them in different display blocks. | ||||||
|
|
||||||
| ```html | ||||||
| <div><a href="https://www.w3.org/WAI/">Read more</a> about the W3C WAI</div> | ||||||
| <div><a href="https://www.w3.org/International/">Read more</a> about the W3C internationalization</div> | ||||||
| ``` | ||||||
|
|
||||||
| [accessible name]: #accessible-name 'Definition of accessible name' | ||||||
| [accessible description]: #accessible-description 'Definition of Accessible Description' | ||||||
| [document]: https://dom.spec.whatwg.org/#concept-document 'Definition of document' | ||||||
| [explicit role]: #explicit-role 'Definition of explicit role' | ||||||
| [included in the accessibility tree]: #included-in-the-accessibility-tree 'Definition of included in the accessibility tree' | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,21 @@ | ||||||
| --- | ||||||
| title: Accessible Description | ||||||
| key: accessible-description | ||||||
| unambiguous: true | ||||||
| objective: true | ||||||
| input_aspects: | ||||||
| - Accessibility tree | ||||||
| - CSS styling | ||||||
| - DOM tree | ||||||
| --- | ||||||
|
|
||||||
| The _accessible description_ is the programmatically determined description of a user interface element that is [included in the accessibility tree](#included-in-the-accessibility-tree). The accessible description provides information that complements the [accessible name][]. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Never noticed that our def of "accessible name" is only for "UI element" 🤔 Feels a bit weird or restrictive (and maybe ambiguous since we usually use "instrument"). Again not related to this PR.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with @Jym77. I think it's not just about user interface components. |
||||||
|
|
||||||
| The accessible description is calculated using the [accessible name and description computation][]. | ||||||
|
|
||||||
| For native markup languages, such as HTML and SVG, additional information on how to calculate the accessible description can be found in [HTML Accessibility API Mappings 1.0, Accessible Name and Description Computation (working draft)](https://www.w3.org/TR/html-aam/#accessible-name-and-description-computation) and [SVG Accessibility API Mappings, Name and Description (working draft)](https://www.w3.org/TR/svg-aam/#mapping_additional). | ||||||
|
|
||||||
| **Note:** As per the [accessible name and description computation][], each element with the 'aria-describedby' property always has an accessible description. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| [accessible name]: #accessible-name 'Definition of Accessible Name' | ||||||
| [accessible name and description computation]: https://www.w3.org/TR/accname 'Accessible Name and Description Computation' | ||||||
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 not sure this is obviously correct. The SC talks about link text and programmatically determined context. Its probably worth putting in the assumption that we're using "link text" from WCAG to mean accessible name and description. Links that fail label in name could have visible text that isn't considered "link text" in this rule. I think that should be in the assumption.