-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Labels
engineIssues in the accessibility-checker-engine componentIssues in the accessibility-checker-engine componentenhancementNew feature or requestNew feature or requestuser-reportedIssues identified outside of the core teamIssues identified outside of the core team
Description
Rule description
The current ruleset has a few existing checks to make sure that every <table> has an appropriate <caption> describing its content:
table_caption_nestedmakes sure that any<caption>tags are nested properly inside the<table>tags.table_caption_emptymakes sure that when a<caption>tag is present, it contains text.
However, when tables don't contain captions at all, there is no issue reported. Based on the definition of WCAG 1.3.1: Info and Relationships, and specifically Technique H39: Using caption elements to associate data table captions with data tables, every data table really, really should contain a caption.
I suggest we add a rule for table_caption_exists to verify that data tables have their required captions.
Relevant requirement(s)
1.3.1 Info and Relationships
High-level approach and rule scope
- Every
<table>element that does not also have arole="presentation"orrole="none"attribute should have a<caption>element nested as its first child element OR anaria-labelledbyattribute with a valid ID.aria-labelalone without an on-screen caption is insufficient to meet WCAG 1.3.1. - Every element with the
role="table"orrole="treegrid"attribute should have either anaria-labelattribute with text or anaria-labelledbyattribute with a valid id (see MDN's ARIA: table role and MDN's ARIA: treegrid role.
Ruleset and failure level
WCAG 2.1
Failure level
Violation Recommendation
Different failure level
No response
Failure cases
Table Elements
- Does the
<table>element also have therole="presentation"orrole="none"attribute? Yes: break... not relevant. No: proceed. - Does the
<table>element have a child<caption>element positioned properly as its first child? Yes: pass. No: proceed. - Does the
<table>element have anaria-labelledbyattribute with a valid id? Yes: pass. No: fail.
Elements with Table Roles
- Does an element have a
role="table"orrole="treegrid"attribute? No: break... not relevant. Yes: proceed. - Does this element have an
aria-labelattribute with a non-empty value OR anaria-labelledbyattribute with a valid id? Yes: pass. No: fail.
Metadata
Metadata
Assignees
Labels
engineIssues in the accessibility-checker-engine componentIssues in the accessibility-checker-engine componentenhancementNew feature or requestNew feature or requestuser-reportedIssues identified outside of the core teamIssues identified outside of the core team