Skip to content
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

"Table header cell has assigned data cells" (d0f69e): accept assigned header #1518

Merged
merged 4 commits into from
Dec 21, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
id: d0f69e
name: Table header cell has assigned data cells
name: Table header cell has assigned cells
rule_type: atomic
description: |
This rule checks that each table header has assigned data cells in a table element.
This rule checks that each table header has assigned cells in a table element.
accessibility_requirements:
wcag20:1.3.1: # Info and Relationships (A)
forConformance: true
Expand Down Expand Up @@ -36,7 +36,7 @@ This rule applies to any HTML element with the [semantic role][] of [rowheader][

## Expectation

Each target element is [assigned][] to at least one element with a [semantic role][] of [cell][] or [gridcell][].
Each target element is [assigned][] to at least one element with a [semantic role][] of [cell][] or inheriting from [cell][].

## Assumptions

Expand All @@ -49,6 +49,8 @@ This rule assumes that table header cells have a relationship conveyed through p

## Background

The roles inheriting from `cell` are `columnheader`, `gridcell`, and `rowheader`.

- [Understanding Success Criterion 1.3.1: Information and relationships][sc1.3.1]
- [H43: Using id and headers attributes to associate data cells with header cells in data tables](https://www.w3.org/WAI/WCAG21/Techniques/html/H43)
- [Forming relationships between data cells and header cells][assigned]
Expand Down Expand Up @@ -161,6 +163,33 @@ Each of the 2 `th` elements has an assigned `td` element because the `headers` a
</table>
```

#### Passed Example 6

Each of the 5 `th` elements in this table has assigned cells, whether data or header.

```html
<table>
<caption>
Opening hours
</caption>
<tr>
<th>Day</th>
<th>Morning</th>
<th>Afternoon</th>
</tr>
<tr>
<th>Mon-Fri</th>
<td>8-12</td>
<td>14-17</td>
</tr>
<tr>
<th>Sat-Sun</th>
<td>10-14</td>
<td>Closed</td>
</tr>
</table>
```

### Failed

#### Failed Example 1
Expand Down Expand Up @@ -318,7 +347,6 @@ This `th` element is part of a table which is not [included in the accessibility
[included in the accessibility tree]: #included-in-the-accessibility-tree 'Definition of included in the accessibility tree'
[assigned]: https://html.spec.whatwg.org/multipage/tables.html#header-and-data-cell-semantics 'Forming relationships between data cells and header cells'
[cell]: https://www.w3.org/TR/wai-aria-1.1/#cell 'ARIA cell role'
[gridcell]: https://www.w3.org/TR/wai-aria-1.1/#gridcell 'ARIA gridcell role'
[flat tree]: https://drafts.csswg.org/css-scoping/#flat-tree 'Definition of flat tree'
[table]: https://www.w3.org/TR/wai-aria-1.1/#table 'ARIA table role'
[grid]: https://www.w3.org/TR/wai-aria-1.1/#grid 'ARIA grid role'
Expand Down