Closed carmacleod closed 4 years ago
seems to me that it needs to be updated as:
TD:
role=cell
if a descendant of a table element.
role=gridcell
if a descendant of a table with role=grid
or treegrid
.
Since a tr
is (should be) an implicit role=row
when a child of table
, grid
, or treegrid
, then seems to me it doesn't need any of those quantifiers and it should just say role=row
. We should only be explicitly noting that the role may be set IF the implicit role is not properly communicated, and thus needs to have the role set to correct the gap.
th
has a lot of its own conditions for what the implicit role is...
if a descendant of a table
, role=columnheader
, rowheader
or cell
(if not a header)
if a descendant of grid
/treegrid
, role=columnheader
, rowheader
orgridcell
Related, the roles that May be used on an element should also probably be updated depending on the implicit role...which is a whole other todo here... e.g. if a td
is a child of a role=grid
, depending on the circumstance i'd submit that very well should not allow for any role to be applied to it, since that could break the expected structure of the grid
. Similarly, i find it odd to allow any role on a tr
if the parent table's mapping has not been overwritten by another role. Otherwise it'd be inappropriate to have something like the following, which if you take the spec at face value and don't take into consideration other markup pattern expectations, allows for right now.
<table>
<tr role=list>
<!-- ... -->
</tr>
</table>
th ... if a descendant of a table, role=columnheader, rowheader or cell (if not a header)
By "if no header" do you mean the scope=rowgroup/colgroup
? If yes, the question would be, how this is correctly mapped, so that the information transmitted with this attribute is not lost ...
Surprisingly, the specification in HTML AAM is incomplete: No specification for ARIA mapping and incomplete specification for API mapping:
scope: ... Defines whether the element is a row or column header
@JAWS-test, yes scope=row
or col
. The mappings you linked to for scope
, as well as many others currently marked as "?", are presently held up in a PR due to respec having a build error due to spec tooling changes.
Regardless, that's not a blocker here as we're already aware of what the implicit roles can be.
Sorry - I am just seeing the previous 2 comments. Is there something else I should add to the PR I just created in order to clarify "if not a header"? Maybe instead say:
(if
scope
is not specified)
Regarding the "whole other todo", I could perhaps say (for td, th, tr):
Any role applicable to the ancestor table element's implied or explicit role.
@scottaohara
I wrote:
By "if no header" do you mean the scope=rowgroup/colgroup?
Your anwser:
yes scope=row or col
The question remains, how rowgroup and colgroup are meaningfully mapped
Thanks @JAWS-test. Misread what you were asking. Those are also mapped as row header and column header.
what i meant by my original comment is that th
s could be exposed as a cell
... though testing that again today with modern browsers, I'm not sure that's actually still the case... at least in how they're being mapped. how they're announced by screen readers may be another topic all together.
but scope=row is something else than scope=rowgroup (and col and colgroup are similarly different). If AT only interprets both as rowheader or columnheader, I think that's wrong. The corresponding ARIA role is simply missing here, isn't it?
yes, they are different in what they imply. A header scoped to a row vs a rowgroup and similar for columns... but at some point the platform APIs apparently decided that the purposes were close enough separate mappings / exposed roles were not created.
All that said, this is getting off topic for the scope of the ARIA in HTML spec. If a new role needs to be created and uniquely exposed it could be brought up with the ARIA / CORE AAM specs.
Reopening #60 because ARIA in HTML is now inconsistent with HTML AAM for "gridcell", and because browsers are now using implied role of "gridcell" when
td
is in "grid".The HTML AAM spec says that in certain circumstances, td (and th) map to gridcell:
To see this in Chrome:
Firefox also defaults to
role="gridcell"
fortd
ingrid
. Did not check Safari, but Chrome + FF = 2.So the ARIA in HTML entry for td (and th) need to say basically the same thing as HTML AAM for td and th.
Also, the tr entry seems a bit oddly worded now, given that
tr
ingrid
(andtreegrid
) defaults torow
.It currently says:
but I think it only needs to say:
I will provide a PR shortly.