Skip to content

ElementInternals: convert lib/core/utils idref resolution to handle internals element references #5149

Description

@Garbee

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

Scope: lib/core/utils (idref resolution — independent & foundational; sequence early)

Representative files/usages:

  • idrefs
  • get-accessible-refs
  • get-element-by-reference
  • get-node-attribute

This layer must handle internals' pre-resolved element arrays (proposal "Should handle" #5: an idrefs property is an array of resolved Elements, not a space-separated id string) and the empty-idref Firefox crash (#5139). Several commons/checks sub-issues (commons/aria, commons/text, checks/shared, checks/tables) call through these, so correct idref/array behavior here unblocks them — land it alongside the foundational commons work rather than at the end.

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; for idref(s) return resolved vNode arrays and filter out disconnected 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.

Out of scope

role-attribute reads (#5039); validity checks; rule selector matching; form-label work (#5045).

Dependencies

Blocked by #5043; requires getAriaValue/hasAriaValue (#5042).

Acceptance criteria

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions