-
Notifications
You must be signed in to change notification settings - Fork 50
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
Revise allowed roles/attributes on table elements #258
Comments
a table currently allows for any role. Per issue 97, that could be restricted to That said, I think we could still tone down the "any role" to be a bit more reasonable. e.g., Regarding table children which also presently allow any role, which is also a bit much and should not be allowed when the ancestor table is still exposed as a table, here's a basic draft stub for such table children:
So for instance for this table content (and this is where @stevefaulkner @patrickhlauke further thoughts please? |
I think that at For all child elements of
|
@JAWS-test
As mentioned, i theoretically would agree with this if not for it making the remediation of legacy table layouts much more difficult. per your second points about children of tables, agree on the second bullet as that's in my quick draft. Per your first bullet though, I think the spec can be a bit more reserved on any role. E.g., is there really a good reason for allowing |
I'm afraid I don't understand that. If I have a layout table, I have to use role=presentation. But role=article should not be allowed. But I would still expect AT to interpret this incorrect markup like role=presentation at the table and additionally role=article.
There is no good reason for it. But there is no good one against it either. From the logic of the specification, all roles should be allowed on elements that have no implicit role. Otherwise I could also say button is allowed on div, but not on span. |
@JAWS-test that's not exactly correct. Yes, you can use regarding your second point, i don't agree with there not being definable cons that would dissuade being mindful of what's allowed on a table children, particularly those that are used solely to group rows/cells of potentially structured content. Yes, a similar argument could be made towards |
I want to bring up the following to reconsider the current ARIA spec for role attributes on table elements I'm currently using Adrian Roselli's technique for responsive tables: It "destroys" semantics of HTML table elements via CSS by setting them all to The new ARIA spec allows no implicit role on the table elements
This reflects the spec saying:
See Document conformance requirements for use of ARIA attributes in HTML I would like to make a point to reconsider this. In my view it may be valid to disallow all other role attributes, when ancestor table is |
It seems to me that there are two issues here.
All that said, as the title of this issue states we will be looking at additional updates to table element rules for the next version of ARIA in HTML. If there are any additional rules or edits needed to existing element rules, we will definitely continue to review/take those into consideration. |
Adding on to what was said by @accessabilly. At NHS we have a responsive table which works in a similar way to the Adrian Roselli tables. Where we use fixed roles to maintain the tables default roles despite the CSS changes. This also leads to use getting numerous HTML validation errors such as Perhaps these could be changed to only cause the warning only for unncessary roles which it currently does, but ideally without the error. |
Hi @Fenwick17 |
a recent issue has popped up with the html validator where what should have been allowed is being flagged: validator/validator#1304 adding that here in lieu of the above discussion. need to take a new look at what's been done for resolving this issue, and re-review what was updated in the spec. we want to make sure that we aren't making anything invalid that isn't causing actual issues. |
Currently ARIA in HTML does not allow These Firefox issues give code examples and explanations of why it should be allowed: https://bugzilla.mozilla.org/show_bug.cgi?id=1257490 For comparison, |
clarification: li does presently allow role=none, but that's also a bug in the current spec and will be addressed when this PR is implemented by another checker: #410 |
@scottaohara does the use case, which I cited above in Bugzilla, convince you that we should allow I realize that a developer could make the mistake of
I've commented #410. |
Two more possibilities:
|
That's actually quite different in reality, as per your example, the HTML parser would kick out that errant span and render it in the DOM prior to the table element. The content would then be consistently accessible, and visually the developer would likely see their error as their content didn't appear in the table as they expected. However, a cell which was set to role=none but had content would then remain in the rendered table, but be inconsistently inaccessible as the cell would no longer be reachable by someone using table navigation with their screen reader. One could reach that content if they did not use table navigation... but the practical discoverability of that would likely be low. As per my comment in the |
Good point, and thanks for the clear explanation. Now I'm fine with disallowing |
Presently we indicate that table elements can allow for any role, and while this makes sense in the context of the legacy issues of table misuse it's not really accurate for modern web development.
Additionally, there needs to be more clarity specifically for table descendants that "any role" is really only applicable if the immediate table ancestor is not exposed as a table or grid. For instance, the following is nonsense but presently throws no validation errors.
This issue closes #97
The text was updated successfully, but these errors were encountered: