Skip to content

ElementInternals: convert lib/checks/aria to getAriaValue/hasAriaValue #5144

Description

@Garbee

Part of #5044 — incremental, per-subdirectory conversion of ARIA-attribute reads to the new internals-aware resolvers.

Scope: lib/checks/aria (the largest sub-issue — consider splitting into 2 PRs if a single diff gets unwieldy)

Representative files/usages:

  • aria-allowed-attr, aria-prohibited-attr
  • aria-required-attr (aria-valuetext, aria-expanded, variable requiredAttr)
  • aria-required-children (aria-busy)
  • aria-conditional-attr / aria-conditional-row-attr / aria-conditional-checkbox-attr
  • aria-errormessage (aria-errormessage, aria-invalid)
  • aria-level, aria-busy
  • has-global-aria-attribute
  • braille-label-equivalent (aria-braillelabel)
  • braille-roledescription-equivalent (aria-brailleroledescription, aria-roledescription)

Conversion pattern (shared by every #5044 sub-issue)

  1. Replace ARIA-attribute reads — vNode.attr('aria-*') / vNode.hasAttr('aria-*'), incl. variable-attr forms — with getAriaValue / hasAriaValue, only where reading an internals-supplied value makes sense.
  2. Consume normalized/typed return values (booleans; resolved vNode arrays for idref(s)); filter unattached elements (see ElementInternals: accessing empty internals idrefs property crashes Firefox #5139).
  3. Add ElementInternals test fixtures (_internals and axeInternalsMap) mirroring existing virtual-node tests.
  4. Update messages that name an ARIA attribute/role to reflect value source where confusing (e.g. avoid "ARIA attribute not allowed: aria-label" when the value came from internals).

Out of scope

role-attribute reads (#5039); the validity checks aria-valid-attr, aria-valid-attr-value, aria-unsupported-attr (they inspect the literal HTML attribute set on purpose — do not convert); rule selector matching; form-label work (#5045).

Dependencies

Blocked by #5043; requires getAriaValue/hasAriaValue (#5042). Prefer landing after the lib/commons/aria sub-issue.

Acceptance criteria

  • Existing suite green with elementInternals: false.
  • New internals fixtures pass with elementInternals: true.
  • Messages updated where they name an attribute/role.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions