Skip to content

Reporting an incorrect usage of scope attribute on TH tag #244

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

Closed
matiasmm opened this issue Oct 25, 2016 · 3 comments
Closed

Reporting an incorrect usage of scope attribute on TH tag #244

matiasmm opened this issue Oct 25, 2016 · 3 comments
Labels
help wanted We welcome PRs or discussions for issues marked as help wanted

Comments

@matiasmm
Copy link

matiasmm commented Oct 25, 2016

I'm testing a website using AXE chrome extension and it is reporting an incorrect usage of the scope attribute.
The html chunk that is producing the error is: <th style="" scope="col">Product</th>
What I understand of the error is that scope can only be used on TH tags, but that's the case, so it's not clear why it is being reported.

The output of the extension is here:

Ensures the scope attribute is used correctly on tables
(More Info)

    best-practice

Target:#partner-signup > div:nth-of-type(2) > .main-col > .order-confirmation > table > thead > tr > th:nth-of-type(1)
HTML:

<th style="" scope="col">Product</th>

Summary:
Fix all of the following:

    In HTML 5, scope attributes may only be used on table header elements (<th>)
@matiasmm matiasmm changed the title Reporting an incorrect usage of the scope="col" on TH tag Reporting an incorrect usage of scope attribute on TH tag Oct 25, 2016
@matiasmm
Copy link
Author

I've figured what the issue is after I debugged how does this check work: https://github.com/dequelabs/axe-core/blob/master/lib/checks/tables/html5-scope.js

The problem is in the <!DOCTYPE> tag. I'm using a doctype for html4:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> instead of <!DOCTYPE html> for html5.

I think the error message could be more clear, it is checking two things: that the page is html5 and that the scope is being used in a TH tag, but it's only reporting the second issue.

@marcysutton marcysutton added help wanted We welcome PRs or discussions for issues marked as help wanted rules Issue or false result from an axe-core rule tables and removed rules Issue or false result from an axe-core rule labels Oct 31, 2016
@dylanb
Copy link
Contributor

dylanb commented Nov 10, 2016

@marcysutton
Copy link
Contributor

It looks like this was already fixed, so I'm going to close the issue. Let us know if it persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We welcome PRs or discussions for issues marked as help wanted
Projects
None yet
Development

No branches or pull requests

3 participants