Skip to content
This repository was archived by the owner on Jul 30, 2019. It is now read-only.
This repository was archived by the owner on Jul 30, 2019. It is now read-only.

aria-sort on table headers requires a bunch of redundant roles #909

Closed

Description

@DavidMacDonald

There apparently was a bug filed against the validator that it complained when aria-sort is added to a <th>. It required role="columnheader" The bug was closed because the spec apparently requires it.
Apparently this is because <th> is not supposed to have any semantic value because there are so many layout tables in the wild so the dev has to add a redundant aria role.

It seems like a weird situation, I think it should be perfectly fine to do this and not require redundant aria <th aria-sort="ascending" ...>

Can we solve this, and not burden developers by forcing them to add redundant roles?

Here's a stack overflow discussion

Activity

  1. stevefaulkner commented on Jun 15, 2017

    @stevefaulkner
    Contributor

    @DavidMacDonald this is the wrong spec to file this issue on, also it is not the case that th has no semantics - see the API mappings https://w3c.github.io/html-aam/#el-th

  2. DavidMacDonald commented on Jun 16, 2017

    @DavidMacDonald
    Author

    @stevefaulkner

    Then the Validator should not throw an error on this, right?
    <th aria-sort="ascending" ...>
    So should the bug be filed there? I've reopened over there.

  3. sideshowbarker commented on Jun 17, 2017

    @sideshowbarker
    Member

    The ARIA spec itself is the relevant spec here.

    So, see https://www.w3.org/TR/wai-aria-1.1/#h-aria-sort, which says that aria-sort must not be used when the role value is anything other than columnheader or rowheader.

    If you want for the ARIA spec to say that columnheader or rowheader should be allowed even with the explicit role value isn’t columnheader or rowheader then I guess you need to raise an issue against the ARIA spec requesting that.

  4. DavidMacDonald commented on Jun 26, 2017

    @DavidMacDonald
    Author

    @stevefaulkner

    also it is not the case that th has no semantics - see the API mappings https://w3c.github.io/html-aam/#el-th

    I see, it gets role="cell"

    This is very generic. There are two types of cells in HTML tables. Headers <th> and data <td>. Why not map it to one of those in the API, instead of cell?

    Then we can file a bug against wai-aria to allow an api mapping of generic header in addition to columnheader and rowheader

    this will offload the burden that is on authors currently, which forces them to add an role to th every time they want to use aria-sort

  5. hartman commented on Jun 29, 2017

    @hartman

    I think it should be noted that columnheader and rowheader themselves are defined as th[scope="col"] and th[scope="row"] base concepts.

    The scope attribute itself however is currently a question mark in AAM: https://w3c.github.io/html-aam/#att-scope

  6. LJWatson commented on Jun 29, 2017

    @LJWatson
    Collaborator

    Please note this issue has been closed in relation to the HTML spec. Issues relating to ARIA and the HTML AAM should be filed on the relevant repos:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions