This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26418 - Default ARIA roles for tables
Summary: Default ARIA roles for tables
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC All
: P3 normal
Target Milestone: ---
Assignee: steve faulkner
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-23 14:57 UTC by Craig Francis
Modified: 2014-08-03 13:25 UTC (History)
4 users (show)

See Also:


Attachments

Description Craig Francis 2014-07-23 14:57:04 UTC
The HTML5 validator requires ARIA @role attributes when specifying @aria-sort on a table... the roles being "grid", "row", "columnheader", "rowheader" and "gridcell"... which seem to be redundant information.

The issue seems to be that the "default implicit ARIA semantics" does not set these roles for tables:

http://www.w3.org/html/wg/drafts/html/master/dom.html#sec-implicit-aria-semantics

I believe this decision may be due to tables being used for layout.

However as websites should now be using CSS, and considering that anyone who isn't probably has bigger accessibility issues (where role="presentation" is still available to them), I would personally like to avoid the relatively redundant attributes... e.g.

<table role="grid"> to <table>
<tr role="row"> to <tr>
<th scope="col" role="columnheader" aria-sort="ascending"> to <th scope="col" aria-sort="ascending">

In the same way that the following should be possible, and seems to be what most developers use:

<footer role="contentinfo"> to <footer>.

See the two example tables at:

http://lists.w3.org/Archives/Public/www-validator/2014Jul/0013.html
Comment 1 steve faulkner 2014-08-03 13:25:50 UTC
Hi Craig, 
Looking into this issue i believe the error being reported by the validator was partially incorrect as aria-sort can be used on either a grid or table [1]. However it was not defined in the HTML the spec that th elements with a scope of col/row mapped to columnheader/rowheader. I have updated the spec to reflect that they do[2]. 

what this means for conformance purposes is that 

<th scope="col" aria-sort...>

<th scope="row" aria-sort...>

will not require explicit roles to be declared.

I will respond on the validator bug to get this implemented.

[1] http://www.w3.org/TR/wai-aria/states_and_properties#aria-sort

[2] https://github.com/w3c/html/commit/267fcd3748e6c75d8e9e569b6eecf4eec8fb6eed