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

"Headers attribute specified on a cell refers to cells in the same table element" [a25f45]: require headers to be th elements #2110

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

tombrunet
Copy link
Collaborator

@tombrunet tombrunet commented Aug 31, 2023

Updates based on #1910

  • Added to the expectation that the referenced element is expected to be a th
  • Updated Pass 3 and Fail 4.

Closes issue(s):

Need for Call for Review:

This will require a 2 weeks Call for Review


Pull Request Etiquette

When creating PR:

  • Make sure you're requesting to pull a branch (right side) to the develop branch (left side).
  • Make sure you do not remove the "How to Review and Approve" section in your pull request description

After creating PR:

  • Add yourself (and co-authors) as "Assignees" for PR.
  • Add label to indicate if it's a Rule, Definition or Chore.
  • Link the PR to any issue it solves. This will be done automatically by referencing the issue at the top of this comment in the indicated place.
  • Optionally request feedback from anyone in particular by assigning them as "Reviewers".

When merging a PR:

  • Close any issue that the PR resolves. This will happen automatically upon merging if the PR was correctly linked to the issue, e.g. by referencing the issue at the top of this comment.

How to Review And Approve

  • Go to the “Files changed” tab
  • Here you will have the option to leave comments on different lines.
  • Once the review is completed, find the “Review changes” button in the top right, select “Approve” (if you are really confident in the rule) or "Request changes" and click “Submit review”.
  • Make sure to also review the proposed Call for Review period. In case of disagreement, the longer period wins.

@tombrunet tombrunet added the Rule Update Use this label for an existing rule that is being updated label Aug 31, 2023
@tombrunet tombrunet self-assigned this Aug 31, 2023
@tombrunet
Copy link
Collaborator Author

@WilcoFiers I put in a change to the expectation based on the issue description, but I'm a bit hesitant about that. I think ATs handle this regardless of whether or not it points to a td or a th. We certainly don't have any fail examples here to demonstrate that. I certainly agree that the examples should be in line with the spec. But, should we:

  1. Keep this change to the expectation
  2. Revert the expectation and add a failure case where a headers attribute points to a td element
  3. Revert the change and do not add new test cases

@@ -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.
Copy link
Member

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 tds, 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?

Copy link
Collaborator

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.

Copy link
Collaborator Author

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 a th, it reads the referenced headings in both cases. Surprisingly, NVDA and desktop Voiceover seem to ignore the headers attribute and use the automatic calculation - they won't read td's, but they read the th at the top of the column rather than the th that I referenced via headers.

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.

Copy link
Collaborator Author

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.

Comment on lines +120 to +121
<th role="columnheader" id="header1">Projects</th>
<th role="columnheader" id="header2">Objective</th>
Copy link
Member

Choose a reason for hiding this comment

The 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 headers referencing td elements we should have a new failed example for it. What we have now references an element inside the cell, which I do think is a problem.

@Jym77 Jym77 changed the title Updates based on issue 1910 "Headers attribute specified on a cell refers to cells in the same table element" [a25f45]: require headers to be th elements Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rule Update Use this label for an existing rule that is being updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule a25f45 table headers - mismatch between rule applicability, examples and HTML spec
3 participants