dequelabs / dequelabs/axe-core

axe-core does not recognize scope="rowgroup" and scope="colgroup" as row and column headers

Open
#3,967 0 comments 0 reactions 0 assignees View on GitHub
fix
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

### Product

axe-core

### Product Version

4.6.3

### Latest Version

- [X] I have tested the issue with the latest version of the product

### Issue Description

#### Expectation

I expect axe-core to treat `th[scope="rowgroup"]` as a row header and `th[scope="colgroup"]` has a column header. A couple of ways this manifests itself is when using the `axe.commons.table.getScope()`, `axe.commons.table.isRowHeader()` and `axe.commons.table.isColumnHeader()` methods.

#### Actual

It treats the scope of these headers as "auto".

#### How to Reproduce

1. Go to the "Table with Two Tier Headers" example at https://www.w3.org/WAI/tutorials/tables/irregular/
2. Inject axe-core into the page
3. In the inspector, select the "Mars" header
4. Run `axe.commons.table.getScope($0)`
- Output is "auto"
5. Run `axe.commons.table.isRowHeader($0)`
- Output is `true`

#### Additional context

I believe this can be resolved by including `rowgroup` and `colgroup` as appropriate in the following places

- `get-scope`: https://github.com/dequelabs/axe-core/blob/cce75869be032006dc505a2af853886943973319/lib/commons/table/get-scope.js#L32
- `is-row-header`: https://github.com/dequelabs/axe-core/blob/cce75869be032006dc505a2af853886943973319/lib/commons/table/is-row-header.js#L12
- `is-column-header`: https://github.com/dequelabs/axe-core/blob/cce75869be032006dc505a2af853886943973319/lib/commons/table/is-column-header.js#L12

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.