-
Notifications
You must be signed in to change notification settings - Fork 353
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
Data grid examples should use gridcell role #1030
Comments
Hi @aleventhal ! I believe it's intentional. The example states:
The HTML AAM and CORE AAM map tr to row, td in grid to gridcell, th as column header to columnheader, and th as row header to rowheader. So the grid example is working by design and not just by luck, because AT implemented the mappings. That said, I see that the HTML spec (which new authors would be more familiar with) is a little fuzzy on this point... it seems to be missing the "if it's in a grid" default roles:
Also, other APG examples do tend to have more of a "divs and spans with ARIA" approach, and I can see your point that the grid example might be confusing without that. It wouldn't be too difficult to rewrite this example using a div with display:table, div rows and span gridcells, etc. @mcking65 What do you think? Would you prefer the "divs, spans, and ARIA" approach? |
I'm not saying that it's necessary to remove the |
Does it? I'm not sure. There's definitely confusion around that. It used to be needed in the past, particularly for newer HTML5 elements like section elements, but I think it mostly shouldn't be needed today. The W3C HTML spec for each element says:
The ARIA in HTML spec says:
Steve F's 2015 On HTML belts and ARIA braces article is still mostly relevant (although today's browsers and AT don't need roles on section elements any more). Anyhow, I submitted a PR to the W3C HTML spec to fix up the fuzziness. Hopefully that will help clarify. (The WHATWG spec seems to just point to the HTML-AAM in one place, as far as I can tell, and none of its elements seem to explicitly mention their default role or supported aria attributes. This may be the source of some of the confusion, because if new aria authors are coming from the WHATWG spec, then they have had very little exposure to ARIA before trying to use it). |
Regarding data grid examples, such as this one:
https://www.w3.org/TR/wai-aria-practices-1.1/examples/grid/dataGrids.html#ex1_label
The descendants have been implemented without include role="gridcell". They rely on the hope that a
<td tabindex="-1">
element is exposed the same way as a role="gridcell". The fact that it works is more lucky than good, and is confusing to new ARIA authors.The ARIA spec says that a grid has required owned elements of row, which has required owned elements of gridcell.
Even if it could be argued that it's ok because HTML AAM and CORE AAM use similar mappings for the two things, I think it's probably not explicitly ARIA and therefore confusing.
The text was updated successfully, but these errors were encountered: