Skip to content

fix(engine): Preserve presentational image semantics when resolving roles - #2661

Draft
mugiwarafx wants to merge 1 commit into
IBMa:main-4.xfrom
mugiwarafx:fix/act-ffd0e9-heading-name
Draft

mugiwarafx wants to merge 1 commit into
IBMa:main-4.xfrom
mugiwarafx:fix/act-ffd0e9-heading-name

Conversation

@mugiwarafx

@mugiwarafx mugiwarafx commented Oct 22, 2026 •

Copy link
Copy Markdown

Summary

An image with a non-empty alt and role="presentation" currently contributes a name to its containing heading because getResolvedRole filters explicit roles through the host element's author-conformance allowlist. Both heading checks therefore pass ACT ffd0e9 Failed Example 4, which expects failure:

<h1><img alt="ACT rules" role="presentation"></h1>

Resolve the first supported explicit role independently of author validation, retaining presentational-role conflict handling for focusability (including negative tabindex) and global ARIA attributes. getInvalidRoles continues to validate author conformance against the existing tables. Explicit-only lookups use a separate cache entry to prevent implicit-role results from leaking between lookup modes.

This shared-resolver change also restores two missing-parent failures in an existing fixture (treeitem and menuitem roles on disallowed hosts). Regression tests cover the heading example, role precedence, focus/global-attribute exceptions, and cache order. The draft leaves ACT mapping and the remaining ffd0e9 discrepancies for follow-up, and requests review of the resolver behavior in the context of #2629's IBM guidance alignment requirement.

  • New or modified checker rule(s)
  • New or modified help files
  • Simulator updates
  • Extension UI changes
  • Automated tool changes
  • Other (Shared engine utility and regression tests)

This PR is related to the following issue(s):

Testing reference:

  • npm run build-debug: passed.
  • npm test: 1,641 passed (1,619 existing tests plus 22 new regression tests).
  • npm run test:sr -- --port 9878: 332 passed.
  • Compared the same 15 ffd0e9 fixtures before and after the change: only Failed Example 4 changes, from passed to failed in both candidate rules. This was a local engine probe, not the full ACT driver.
  • git diff --check: passed. Local validation used Node v24.16.0 and Chrome 155 on macOS.

I have conducted the following for this PR:

  • I validated this fix in my local env and provided testing information above
  • I understand that the title of this PR will be used for the next release notes.
  • I added I agree to the DCO at https://developercertificate.org/ for this contribution. as a comment after creating the pull request.

Assets to aide review attached

  • Links to design artifacts
  • Links to video walkthrough of user experience
  • Other

Definition of Done

  • Peer review complete
  • Secondary review complete
  • Staging deployment verified

…oles

Signed-off-by: mugiwarafx <sangalesbenes@uoc.edu>
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.

1 participant