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

"td-has-header" or no other rule fails when the 'headers' attribute on a <th> element is empty #2028

Open
iamrafan opened this issue Feb 6, 2020 · 3 comments
Labels
feat New feature or enhancement needs discussion More discussion is needed to continue rules Issue or false result from an axe-core rule support

Comments

@iamrafan
Copy link
Contributor

iamrafan commented Feb 6, 2020

td-has-header fails when <td> element has headers="" but not when <th> element has headers=""

Expectation: Flag <th> elements with headers=""

Actual: <th> elements with headers="" are not flagged

Motivation: There is a chance an author might have missed pointing the <th> (i.e. sub-heading) element to the parent header

Repro example:

    <table>
        <tr>
            <th rowspan="2" id="h">Homework</th>
            <th colspan="3" id="e">Exams</th>
            <th colspan="3" id="p">Projects</th>
        </tr>
        <tr>
            <th id="e1" headers="e">1</th>
            <th id="e2" headers="e">2</th>
            <th id="ef" headers="e">Final</th>
            <th id="p1" headers="p">1</th>
            <th id="p2" headers="">2</th>
            <th id="pf" headers="p">Final</th>
        </tr>
        <tr>
            <td headers="h">15%</td>
            <td headers="e e1">15%</td>
            <td headers="e e2">15%</td>
            <td headers="e ef">20%</td>
            <td headers="p p1">10%</td>
            <td headers="p p2">10%</td>
            <td headers="p pf">15%</td>
        </tr>
    </table>

axe-core version: 3.4.1-canary.6e4ed6b
axe-Coconut version: v4.2.1 
@straker
Copy link
Contributor

straker commented Feb 7, 2020

Thanks for the issue.

@straker straker added fix Bug fixes rules Issue or false result from an axe-core rule support labels Feb 7, 2020
@WilcoFiers WilcoFiers removed the fix Bug fixes label Feb 11, 2020
@straker straker added the feat New feature or enhancement label Feb 11, 2020
@WilcoFiers
Copy link
Contributor

I'm not sure this should fail. I don't think we can say that with any kind of certainty. I'd be more inclined to mark an empty headers attribute for review in the td-headers-attr rule instead. Perhaps we can include th elements in that rule?

@WilcoFiers
Copy link
Contributor

@iamrafan any thoughts?

@WilcoFiers WilcoFiers added the needs discussion More discussion is needed to continue label Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or enhancement needs discussion More discussion is needed to continue rules Issue or false result from an axe-core rule support
Projects
None yet
Development

No branches or pull requests

3 participants