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

Report headers attribute referencing other <td> elements as unsupported #3987

Open
WilcoFiers opened this issue Apr 13, 2023 · 2 comments
Open
Labels
feat New feature or enhancement good first issue For first-time contributors rules Issue or false result from an axe-core rule

Comments

@WilcoFiers
Copy link
Contributor

The headers attribute on td elements should not be allowed to reference other td elements by the td-headers-attr rule.

The following should fail this rule:

<table>
  <tr>
    <td id="hdr1">Hello</td>
    <td id="hdr2">World</td>
  </tr>
  <tr>
    <td headers="hdr1">A</td>
    <td headers="hdr2">1</td>
  </tr> 
  <tr>
    <td headers="hdr1">B</td>
    <td headers="hdr2">Wor2ld</td>
  </tr>
</table>

While HTML doesn't explicitly prohibit this, this does not seem to work with any screen reader running against a Chromium browser.

@WilcoFiers WilcoFiers added feat New feature or enhancement rules Issue or false result from an axe-core rule good first issue For first-time contributors labels Apr 13, 2023
@WilcoFiers
Copy link
Contributor Author

The way to solve this is by adding code to test the node name in lib/checks/tables/td-headers-attr-evaluate.js. We'll need both unit tests for the check (test/checks) and integration tests (test/integration/rules/)

@jlin95
Copy link
Contributor

jlin95 commented Jul 27, 2023

Hi @WilcoFiers , I'd like to take this if it's not assigned yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or enhancement good first issue For first-time contributors rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

2 participants