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 · 3 comments · May be fixed by #4589
Open

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

WilcoFiers opened this issue Apr 13, 2023 · 3 comments · May be fixed by #4589
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.

@engineerklimov
Copy link
Contributor

Dear @WilcoFiers,

I've solved this issue in the below PR so that you can review and advise
#4589
Thank you!

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
3 participants