Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9e42589
rule: table heeader cells refer to data cells
jeeyyy Jan 31, 2019
abaef6a
test: add test cases
jeeyyy Feb 18, 2019
cba574e
fix: udpate based on rreviews
jeeyyy Mar 4, 2019
41729e6
merge from develop
jeeyyy May 13, 2019
c6d6805
update rule
jeeyyy May 13, 2019
1b9e9d1
delete layout table def
jeeyyy May 13, 2019
e184b81
Update table-header-cells-refer-to-data-cells-d0f69e.md
jeeyyy May 13, 2019
327ce1c
Merge branch 'develop' into rule-th-refers-cells
jeeyyy May 29, 2019
0c4e650
update rule
jeeyyy May 30, 2019
5ce8958
Merge branch 'develop' into rule-th-refers-cells
jeeyyy May 30, 2019
4a8f73b
Merge branch 'develop' into rule-th-refers-cells
jeeyyy May 31, 2019
681fffc
update
jeeyyy May 31, 2019
3c06dd3
merge from devellop
jeeyyy May 31, 2019
a915f91
updates
jeeyyy Jun 7, 2019
38a14e8
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Jun 24, 2019
7d1f313
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Jul 1, 2019
bfea1a6
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Jul 11, 2019
08e8be2
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Jul 15, 2019
9b4f790
update
jeeyyy Jul 15, 2019
eb912da
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Jul 16, 2019
62fda4e
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Jul 16, 2019
84ae7b4
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Jul 18, 2019
114cc4b
update
jeeyyy Jul 18, 2019
110e2e4
update
jeeyyy Jul 18, 2019
5714782
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Jul 20, 2019
cd848a5
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Jul 23, 2019
2283656
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Jul 24, 2019
acdeaec
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Jul 29, 2019
085c3e7
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Jul 30, 2019
15d965d
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Aug 2, 2019
29d943c
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Aug 7, 2019
dec9af3
chore: merge from develop
jeeyyy Sep 10, 2019
f6c3474
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Sep 25, 2019
52de444
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Sep 25, 2019
c2e3975
Merge branch 'develop' into rule-th-refers-cells
WilcoFiers Sep 25, 2019
789ec7b
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Oct 10, 2019
d53d6a1
fix: update applicability and expectation
jeeyyy Oct 10, 2019
a05a662
fix: update examples
jeeyyy Oct 10, 2019
5293c2a
fix: failing tests
jeeyyy Oct 10, 2019
6818eb5
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Oct 16, 2019
f0c3bf7
updated
jeeyyy Oct 16, 2019
f1784d0
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Oct 16, 2019
8ebf527
fix: frontmatter
jeeyyy Oct 16, 2019
85205f1
update
jeeyyy Oct 18, 2019
af38ffd
Merge branch 'develop' into rule-th-refers-cells
jeeyyy Oct 18, 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
3 changes: 3 additions & 0 deletions __tests__/spelling-ignore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@
- rotate3d
- rotateZ
- matrix3d
- rowheader
- columnheader

# ARIA Techniques (https://www.w3.org/WAI/WCAG21/Techniques/#aria)
- ARIA1
Expand Down Expand Up @@ -160,6 +162,7 @@
- H36
- H37
- H42
- H43
- H44
- H58
- H67
Expand Down
202 changes: 202 additions & 0 deletions _rules/table-header-cells-refer-to-data-cells-d0f69e.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
---
id: d0f69e
name: All table header cells have corresponding data cells
rule_type: atomic
description: |
This rule checks that each table header has corresponding data cells in a table element.
accessibility_requirements:
wcag20:1.3.1: # Info and Relationships (A)
forConformance: true
failed: not satisfied
passed: further testing needed
inapplicable: further testing needed
input_aspects:
- DOM Tree
authors:
- Jey Nandakumar
- Audrey Maniez
---

## Applicability

The rule applies to any HTML element that is a [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) in the [flat tree](https://drafts.csswg.org/css-scoping/#flat-tree) of an element having a [semantic role](#semantic-role) of either [table](https://www.w3.org/TR/wai-aria-1.1/#table) or [grid](https://www.w3.org/TR/wai-aria-1.1/#grid), and is [visible](#visible) as well as [included in the accessibility tree](#included-in-the-accessibility-tree), where the element has any of the following [semantic roles](#semantic-role):

- [cell](https://www.w3.org/TR/wai-aria-1.1/#cell)
- [gridcell](https://www.w3.org/TR/wai-aria-1.1/#gridcell)
- [rowheader](https://www.w3.org/TR/html-aria/#index-aria-rowheader)
- [columnheader](https://www.w3.org/TR/html-aria/#index-aria-columnheader)

## Expectation

The target element is either the row or column header for cells that is a [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) in the [flat tree](https://drafts.csswg.org/css-scoping/#flat-tree) of the same [table](https://www.w3.org/TR/wai-aria-1.1/#table) or [grid](https://www.w3.org/TR/wai-aria-1.1/#grid) element, as that of the target element.

**Note:** Assigning headers cells to data cell is performed as per algorithm - [Forming relationships between data cells and header cells](https://html.spec.whatwg.org/multipage/tables.html#header-and-data-cell-semantics).

## Assumptions

_There are currently no assumptions._

## Accessibility Support

_There are no major accessibility support issues known for this rule._

## Background

- [Understanding Success Criterion 1.3.1: Information and relationships](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html)
- [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](https://html.spec.whatwg.org/multipage/tables.html#header-and-data-cell-semantics)

## Test Cases

### Passed

#### Passed Example 1

The column header element has corresponding cell, within the same `table` element.

```html
<table>
<tr>
<th>Time</th>
</tr>
<tr>
<td>05:41</td>
</tr>
</table>
```

#### Passed Example 2

Each column header element has corresponding cells, within the same `table` element.

```html
<div role="table">
<div role="rowgroup">
<div role="row">
<span role="columnheader">Month</span>
<span role="columnheader">Top Temperature</span>
</div>
</div>
<div role="rowgroup">
<div role="row">
<span role="cell">July</span>
<span role="cell">40 C</span>
</div>
<div role="row">
<span role="cell">August</span>
<span role="cell">45 C</span>
</div>
</div>
</div>
```

#### Passed Example 3

Each column header element has corresponding cells within the same table element. In this example the column headers have cells that span multiple columns.

```html
<table>
<thead>
<tr>
<th>Projects</th>
<th>Exams</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2">15%</td>
</tr>
</tbody>
</table>
```

#### Passed Example 4

Each row and column header element has corresponding cells, within the same element having a [semantic role](#semantic-role) of `grid`.

```html
<table role="grid">
<thead role="rowgroup">
<tr role="row">
<td></td>
<th role="columnheader">Breakfast</th>
<th role="columnheader">Lunch</th>
<th role="columnheader">Dinner</th>
</tr>
</thead>
<tbody role="rowgroup">
<tr role="row">
<th scope="row" role="rowheader">Day 1</th>
<td>8:00</td>
<td>13:00</td>
<td>18:00</td>
</tr>
</tbody>
</table>
```

### Failed

#### Failed Example 1

One of the column headers ("Column 2"), does not have corresponding cell within the same `table` element.

```html
<table>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>15%</td>
</tr>
</tbody>
</table>
```

### Inapplicable

#### Inapplicable Example 1

The rule does not apply to table element that is not [included in the accessibility tree](#included-in-the-accessibility-tree).

```html
<table role="presentation">
<tr>
<th>Time</th>
</tr>
<tr>
<td>12:00</td>
</tr>
</table>
```

#### Inapplicable Example 2

The rule does not apply to table element that is not [visible](#visible) in page.

```html
<html>
<style>
.notInPage {
position: absolute;
left: -9999px;
top: -9999px;
}
</style>

<body>
<table class="notInPage">
<tr>
<th>Time</th>
</tr>
<tr>
<td>24:00</td>
</tr>
</table>
</body>
</html>
```