This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
With the following line validator throws incorrect error: <th style="font-weight: normal; width: 0px;" class="sorting_asc" tabindex="0" aria-controls="transfer-wizard_search_results_from" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Tilinumero: activate to sort column ascending">foobar</th> Element th is missing one or more of the following attributes: role. However, I believe role is not allowed in element th?
(In reply to Atte Backman from comment #0) > With the following line validator throws incorrect error: > > <th style="font-weight: normal; width: 0px;" class="sorting_asc" > tabindex="0" aria-controls="transfer-wizard_search_results_from" rowspan="1" > colspan="1" aria-sort="ascending" aria-label="Tilinumero: activate to sort > column ascending">foobar</th> > > Element th is missing one or more of the following attributes: role. > > However, I believe role is not allowed in element th? The current spec says that <th> can have any role value: http://www.w3.org/html/wg/drafts/html/master/tabular-data.html#the-th-element But the spec only allows the aria-sort attribute for elements that have either role=columnheader or role=rowheader. So you need to something like this: <table role=grid> <tr role=row> <th role=columnheader style="font-weight: normal; width: 0px;" class="sorting_asc" tabindex="0" aria-controls="transfer-wizard_search_results_from" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Tilinumero: activate to sort column ascending">foobar</th> ... If that doesn't solve your problem, please feel free to re-open this bug.
Isn't the role implied: http://www.w3.org/TR/wai-aria/roles#columnheader Base Concept: HTML th[scope="col"] i.e. why take a th[scope="col"] and add a role of columnheader, when the role is already known. As far as I'm aware, the role attribute is for when incorrect HTML is being used, perhaps being generated by JS with spans?
Ok, this is more of an issue that needs to be resolved with HTML than the validator: http://lists.w3.org/Archives/Public/www-validator/2014Jul/0014.html
I filed a but against HTML. https://github.com/w3c/html/issues/909#issuecomment-308889446 Editor Steve Faulkner said that <th> does indeed have semantics as shown in the accessibility API mappings doc. https://w3c.github.io/html-aam/#el-th Therefore, this should pass the validator <th aria-sort="ascending" ...> It should not require a redundant aria role="columnheader"