Skip to content

td, th, tr allowances when within a table #38

Closed

Description

@scottaohara

when used within a role=table, grid, treegrid the td, tr, and th elements should not be allowed any explicitly set role, as that would break the a11y mappings of the table, grid or treegrid.
td in role=table
td in role=grid
td in role=treegrid

tr in role=table
tr in role=grid
tr in role=treegrid

th in role=table
th in role=grid
th in role=treegrid

expectations:

  • if a <td>'s ancestor table element has role=table, grid or treegrid - then no allowed role.
  • if a <th>'s ancestor table element has role=table, grid or treegrid - then no allowed role.
  • if a <tr>'s ancestor table element has role=table, grid or treegrid - then no allowed role.
  • if any use of cell, gridcell, row, rowheader, columnheader are found on these elements - then those should produce warnings as being unnecessary

if a td, tr, or th are used within a table with no set role, thus it should be an implicit role=table (regardless of what browser heuristics may do) - then no allowed role
td within a table testcase
th within a table testcase
tr within a table testcase

If td, tr, or th are used within a table where it's role is overwritten by a role not mentioned above (e.g., role=none, article, etc), then these elements can continue to allow any role. the checker already meets this expectation

Activity

  1. gezlemon commented on Mar 30, 2021

    @gezlemon
    Collaborator

    Added check for table, grid, and treegrid ancestors for td, th, and tr

  2. scottaohara commented on Apr 15, 2021

    @scottaohara
    ContributorAuthor

    @gezlemon seems the rules are in place for checking TD within all the scenarios. but tr and th rules don't currently pass.

  3. gezlemon commented on Apr 16, 2021

    @gezlemon
    Collaborator

    Thanks, Scott. I've rearranged logic for checking required ancestors.

  4. scottaohara commented on Apr 19, 2021

    @scottaohara
    ContributorAuthor

    thank you Gez. gave this a look today and results are as expected. thank you

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