Skip to content
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

Clarification regarding implicit role for table elements #506

Open
giacomo-petri opened this issue Jan 31, 2024 · 2 comments
Open

Clarification regarding implicit role for table elements #506

giacomo-petri opened this issue Jan 31, 2024 · 2 comments

Comments

@giacomo-petri
Copy link
Contributor

The implicit role for <table> elements is role="table".

It might be beneficial to include a note indicating that, in cases where the table lacks table headers, it could potentially be interpreted and presented as a "generic" element.

For instance, in accessibility inspectors:

  • Chrome exposes it as a layout table (Role: LayoutTable)
  • Safari exposes it as a generic element (Role: No matching ARIA role)
  • Firefox exposes it as a table (Role: Table)
@scottaohara
Copy link
Member

Before that's done here (as the implicit roles that are mentioned here are not defined by this spec, but rather by HTML AAM), it needs to be specified in HTML AAM.

what you're describing is unfortunately not normatively defined, but one of the ways browsers have evolved handling tables over the years.

similar to Apple removing list semantics from list elements when the list markers are removed. That's not defined anywhere, so it's not called out here or in HTML AAM either (and by that i mean the spec doesn't say the list element can either be a role=list or role=generic - that is just how apple decided to handle this beyond what the spec states they need to do. similarly for the table heuristics you call out).

@giacomo-petri
Copy link
Contributor Author

giacomo-petri commented Feb 1, 2024

@scottaohara, I was contemplating introducing a note similar to the one for the summary element, considering the explicit mention of layout tables in the WCAG. On the other hand, if we extend this practice to tables, there could be other elements with comparable situations worth considering...

About the HTML AAM topic, the discussion on list items could be contentious, given the potential use of a list structure with list-style-type:none while still aiming to preserve and convey the semantic meaning of a list (e.g., in scenarios like a product listing page on a retail website.) This aspect leans towards being a decision for browser implementors, guided by specific assumptions.

In contrast, the table topic differs a bit. WCAG addresses layout tables in its failures, explicitly prohibiting the use of th, caption, and summary. Consequently, for layout tables, it seems reasonable to assign a generic implicit role.

Do you think this should be discussed and maybe considered and documented in HTML AAM?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants