Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update implicit role calculations in ARIAMapper #574

Merged
merged 6 commits into from
Dec 14, 2021

Conversation

carmacleod
Copy link
Contributor

Updates data and code in ARIAMapper.elemToRoleMap/inputToRoleMap
to match the implicitRole data in ARIADefinitions.documentConformanceRequirement/documentConformanceRequirementSpecialTags
and the code in RPTUtil.getElementAriaProperty, which is called by RPTUtil.getImplicitRole.

The ARIADefinitions data and RPTUtil code were originally updated in #414 to match https://www.w3.org/TR/html-aria/ (which moved to W3C Rec status last week!) But the ARIAMapper data/code were not updated at that time.

It is unfortunate that this data and logic for implicitRole is duplicated because that makes it harder to maintain, so I have opened #573 to remove the redundancy some day.

Here are the changes that were needed in ARIAMapper:

  • deleted menuitem element from all places it was refenced, because:
    a) it has not been supported in any browser for a long time (see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menuitem#browser_compatibility),
    b) menu element's role was changed to "list", which is not compatible with having children with role "menuitem"
  • if input type="search" doesn't have a list, its implicit role is "searchbox", not "textbox"
  • input type="password" does not have an implicit role (it is allowed to have attributes that are allowed on textbox - I will be adding a new machanism to cover that)
  • body no longer has "document" role (it now has no implicit role). Instead, the html element has "document" role.
  • dfn has role "term"
  • dt has role "term"
  • fieldset has role "group"
  • figure has role "figure"
  • footer: applied the same changes to header from Header bug: Failure if header parent is not an element (shadow dom?) #431
  • form only has implicit role "form" (landmark) if it has an accessible name
  • meter no longer has implicit "progressbar" role (Default role for meter should not be progressbar w3c/html-aria#44)
  • section only has implicit role "region" (landmark) if it has an accessible name
  • adds check for size="" to select implicit role calculation because parseInt("") returns NaN
  • summary has implicit role "button"
  • svg has implicit role "graphics-document"
  • moved textarea to alphabetical order
  • adds check for parent role === "treegrid" to td
  • change a few == to ===

@tombrunet
Copy link
Member

I think I need to update some of the testcases.

tombrunet
tombrunet previously approved these changes Dec 14, 2021
@tombrunet tombrunet merged commit f9b4809 into master Dec 14, 2021
@tombrunet tombrunet deleted the implicitRoleUpdates branch December 14, 2021 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants