-
Notifications
You must be signed in to change notification settings - Fork 70
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
"Headers attribute specified on a cell refers to cells in the same table element" [a25f45]: require headers to be th
elements
#2110
Open
tombrunet
wants to merge
9
commits into
act-rules:develop
Choose a base branch
from
tombrunet:issue-1910
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
09c53f4
Updates based on issue 1910
tombrunet 06d58c3
Update _rules/table-headers-attribute-refer-to-data-cells-a25f45.md
tombrunet 1b1f9b0
Merge branch 'develop' into issue-1910
tombrunet 82bdd93
Merge branch 'develop' into issue-1910
Jym77 bae682a
Merge branch 'develop' into issue-1910
tombrunet c356b12
Merge branch 'act-rules:develop' into issue-1910
tombrunet 9b997ca
Update table-headers-attribute-refer-to-data-cells-a25f45.md
tombrunet 3ccf04b
Update table-headers-attribute-refer-to-data-cells-a25f45.md
tombrunet 139863f
Update table-headers-attribute-refer-to-data-cells-a25f45.md
tombrunet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ acknowledgments: | |
authors: | ||
- Audrey Maniez | ||
- Jey Nandakumar | ||
- Tom Brunet | ||
funding: | ||
- WAI-Tools | ||
--- | ||
|
@@ -36,7 +37,7 @@ This rule applies to any `headers` attribute specified on a [`cell`][] within a | |
|
||
## Expectation 1 | ||
|
||
Each target's [attribute value][] is a [set of space separated tokens][]. Each token is the value of the `id` attribute of an element, that is a [`cell`][] of the same [`table`][]. | ||
Each target's [attribute value][] is a [set of space separated tokens][]. Each token is the value of the `id` attribute of an element, which is a [`cell`][] of the same [`table`][] and is a `th` element. | ||
tombrunet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Expectation 2 | ||
|
||
|
@@ -110,14 +111,14 @@ The `headers` attribute on the cell refers to a `th` element within the same `ta | |
|
||
#### Passed Example 3 | ||
|
||
The `headers` attribute on the data cells in the second row refers to a `td` element with a role of `columnheader` within the same `table`. | ||
The `headers` attribute on the data cells in the second row refers to a `th` element with a role of `columnheader` within the same `table`. | ||
|
||
```html | ||
<table> | ||
<thead> | ||
<tr> | ||
<td role="columnheader" id="header1">Projects</td> | ||
<td role="columnheader" id="header2">Objective</td> | ||
<th role="columnheader" id="header1">Projects</th> | ||
<th role="columnheader" id="header2">Objective</th> | ||
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. Probably don't need the role anymore if we do this. If we're going to fail |
||
</tr> | ||
</thead> | ||
<tbody> | ||
|
@@ -280,7 +281,7 @@ The `td` element has a `headers` attribute referring to its own ID. | |
|
||
#### Failed Example 4 | ||
|
||
The `headers` attribute on the data cells in the second row refers to an element inside the same `table` which does not have a role of `rowheader` or `columnheader`. | ||
The `headers` attribute on the data cells in the second row refers to an element inside the same `table` which is not a [`cell`][] nor a `th` element. | ||
|
||
```html | ||
<table> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 would feel much better about this if we had some test data showing that referencing
td
s, with and without role=row/columnheader doesn't work. Would it be possible to get someone to do some testing before we say this definitely fails WCAG?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.
It is at least invalid HTML: headers attribute, and shouldn't create a relationship: Forming relationship, step 7 only keeps the "headers".
Due to non-interference with the host language, I'd be surprised if that worked. But I agree we should test it nonetheless.
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 used this as a test with just regular HTML:
https://codesandbox.io/s/table-test-68d78y?file=/index.html
JAWS doesn't care if the referenced element is a
td
or ath
, it reads the referenced headings in both cases. Surprisingly, NVDA and desktop Voiceover seem to ignore theheaders
attribute and use the automatic calculation - they won't readtd
's, but they read theth
at the top of the column rather than theth
that I referenced viaheaders
.So, 2 of the 3 desktop screen readers don't handle headers properly even when they're referencing a th. The 3rd doesn't care if it's a td or a th. Given that, I'm having a hard time seeing how this rule has any real world value - the results don't seem to be a factor of what the headers attribute is referencing.
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.
To be clear, I was using Chrome on Mac, and Edge on Windows.