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
Table headers-id rules refactor #38
Conversation
@@ -0,0 +1,131 @@ | |||
--- | |||
rule_id: SC1-3-1-tables-headers-id-correct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest removing "-correct" from the title to keep it terse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a way to differentiate between the two rules -- one "valid," one "correct"
|
||
## Description | ||
|
||
This rule checks that data table headers-id associations reference correct targets in the correct order. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would this rule work with other rules for testing tables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In latest pull, I created a dependency on tables-headers-id-valid rule. Seems like there needs to be a first pass that validates the associations in terms of pure conformance to spec (or, maybe this would be caught by the parser?? and there is no need for the tables-headers-id-value rule???)
|
||
For each un-marked table, select all elements that match the following CSS selector: | ||
|
||
table:not([role=presentation]) th[headers], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following table would match this, even though I don't think that it should:
<table><tr><td>
<table role="presentation"><tr><td headers="">Matching cell</td></tr></table>
</td></tr></table>
The same is true for the selector in the second rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tables are treated in isolation -- loop from innermost out, marking that a table has been checked as you move from table to table. Contents of marked tables is ignored on subsequent loops.
I'm open to a change to the selector if there is a way to exclude nested tables, but I couldn't think of a way to do it in CSS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth filtering out layout tables first? Or would a more specific selector do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking for role of presentation or none is one options, but not all authors implement that. HTML 5.1 spec has some guidance on what one can check - https://www.w3.org/TR/2014/WD-html51-20140617/tabular-data.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kensgists Where can I find these changes? I want to make sure we've got a PR for this.
| Presented item | Highlight a table cell and the related "header" cell. | ||
| Question | Is the cell appropriately categorized by or semantically related with the associated "header" cell? | ||
| Requires context | Yes. An understanding of the data relationships in the table. | ||
| Requires interaction | Yes. Answering the question allows test to proceed to the next step or iteration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should only be 'yes' or 'no'.
…ons, on Wilco's comment. Changed rule to conform to HTML 5.1 spec for headers-id references. Added recommended dependency on SC1-3-1-tables-headers-id-valid rule.
Changes to files address some of @WilcoFiers comments and updates both rules so that headers-id usage conforms to HTML specification. |
Changes are on the issue and I have pushed them to my fork. File is here: https://github.com/kensgists/auto-wcag/blob/master/_drafts/SC1-3-1-tables-headers-id.md. Do you want me to do another PR? Note, that the previous files (tables-headers-id-correct and tables-headers-id-valid) can be removed. They are superseded by this new rule, which merges the other two. |
Yes, please open a PR. I'll add it to the agenda for Thursday's call. |
Original draft rule was refactored into two rules, one fully automatic and the other semi-automatic. Rules were made to conform with the rule template.