Skip to content

Commit d52fcf0

Browse files
Include ancestor generating a block container in the programatically determined link context definition (#1765)
* Update programmatically-determined-link-context.md * update examples to use the updated definition * fix typo * added heading to the prgrammatically determined link context * updated condition of parent with text nodes to ancestor with display block * Removed unused definition * Remove unused definition * Add inapplicable examples showcasing the new contexts considered * Removed headings from programmatically determined context * Removed `p` elements from the definition because they are handled by the display:block condition
1 parent 3a9a657 commit d52fcf0

2 files changed

Lines changed: 35 additions & 8 deletions

File tree

_rules/links-with-identical-names-and-context-serve-equivalent-purpose-fd3a94.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ These two HTML `a` elements have the same [accessible name][] and [context][prog
9595

9696
```html
9797
<html lang="en">
98-
<p>
98+
<div>
9999
Learn more (<a href="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/index.html">About us</a
100100
>) and get in touch (<a href="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/redirect.html"
101101
>About us</a
102102
>)
103-
</p>
103+
</div>
104104
</html>
105105
```
106106

@@ -233,14 +233,14 @@ These two HTML `a` elements have the same [accessible name][] and [context][prog
233233

234234
```html
235235
<html lang="en">
236-
<p>
236+
<div>
237237
Learn more (<a href="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/about/contact.html"
238238
>Contact us</a
239239
>) and get in touch (
240240
<a href="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/admissions/contact.html"
241241
>Contact us</a
242242
>)
243-
</p>
243+
</div>
244244
</html>
245245
```
246246

@@ -370,6 +370,32 @@ These two `span` elements do not have a [semantic role][] of link.
370370
</html>
371371
```
372372

373+
#### Inapplicable Example 5
374+
375+
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].
376+
377+
```html
378+
<html lang="en">
379+
<div>
380+
You can learn more in the
381+
<a href="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/index.html">Contact us</a> page.
382+
</div>
383+
<div>
384+
You can find contact information in the
385+
<a href="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/index.html">Contact us</a> page.
386+
</div>
387+
</html>
388+
```
389+
390+
#### Inapplicable Example 6
391+
392+
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.
393+
394+
```html
395+
<div><a href="https://www.w3.org/WAI/">Read more</a> about the W3C WAI</div>
396+
<div><a href="https://www.w3.org/International/">Read more</a> about the W3C internationalization</div>
397+
```
398+
373399
[accessible name]: #accessible-name 'Definition of accessible name'
374400
[document]: https://dom.spec.whatwg.org/#concept-document 'Definition of document'
375401
[explicit role]: #explicit-role 'Definition of explicit role'

pages/glossary/programmatically-determined-link-context.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ input_aspects:
1111
The _programmatically determined context_ of a link (or _programmatically determined link context_) is the set of all elements that are [included in the accessibility tree][], and have one or more of the following relationships to the link:
1212

1313
- being an [ancestor][] of the link in the [flat tree][] with a [semantic role][] of `listitem`; or
14-
- being the closest [ancestor][] of the link in the [flat tree][] that is a `p` element; or
14+
- being the closest [ancestor][] of the link in the [flat tree][] that generates a [block container][]; or
1515
- being the closest [ancestor][] of the link in the [flat tree][] that has a [semantic role][] of `cell` or `gridcell`; or
1616
- being a header cell [assigned][] to the closest [ancestor][] of the link in the [flat tree][] that has a [semantic role][] of `cell` or `gridcell`; or
1717
- being referenced by an `aria-describedby` attribute of the link.
@@ -20,8 +20,9 @@ This definition is based on the [WCAG definition of programmatically determined
2020

2121
This definition assumes that the HTML document with the link is a document using HTML according to the specification.
2222

23-
[ancestor]: https://dom.spec.whatwg.org/#concept-tree-ancestor
24-
[assigned]: https://html.spec.whatwg.org/multipage/tables.html#algorithm-for-assigning-header-cells
25-
[flat tree]: https://drafts.csswg.org/css-scoping/#flat-tree 'Definition of flat tree'
23+
[ancestor]: https://dom.spec.whatwg.org/#concept-tree-ancestor 'DOM, ancestor, 2021/11/29'
24+
[assigned]: https://html.spec.whatwg.org/multipage/tables.html#algorithm-for-assigning-header-cells 'HTML, algorithm for assigning header cells, 2021/11/29'
25+
[block container]: https://drafts.csswg.org/css-display/#block-container 'CSS Display Module Level 3, block container, 2022/01/17'
26+
[flat tree]: https://drafts.csswg.org/css-scoping/#flat-tree 'CSS Scoping Module Level 1, flat tree, 2021/11/29'
2627
[included in the accessibility tree]: #included-in-the-accessibility-tree 'Definition of included in the accessibility tree'
2728
[semantic role]: #semantic-role 'Definition of semantic role'

0 commit comments

Comments
 (0)