Skip to content

Append DOM editable fallback refs to accessibility snapshots - #53

Merged
wolfiesch merged 2 commits into
mainfrom
dom-fallback-editable-refs
Sep 19, 2026
Merged

wolfiesch merged 2 commits into
mainfrom
dom-fallback-editable-refs

Conversation

@wolfiesch

Copy link
Copy Markdown
Owner

Problem

Some frameworks render editable elements that never enter Chrome's debugger-backed accessibility tree — for example pre-hydration composer textareas. browser_snapshot in accessibility mode mints refs only from Accessibility.getFullAXTree, so those elements have no addressable ref and fill/type cannot reach them.

Change

Full-tree accessibility snapshots now append up to 40 dom_fallback textbox nodes minted from a DOM querySelectorAll("textarea,input,[contenteditable]") pass:

  • Each node carries a normal revisioned ref (r<revision>-<backendNodeId>) that the existing fill/type/click paths already accept — no schema or adapter change anywhere.
  • Elements already present in the accessibility tree (matched by backend node id), non-text-like inputs, and password inputs are skipped.
  • Partial (root_ref) snapshots are unchanged.
  • Any fallback capture failure returns an empty fallback instead of failing the snapshot; the document-identity check still runs after the fallback pass, so refs minted against a swapped document still fail as stale_revision.

Verification

  • packages/extension suite: 116 pass (2 new tests: fallback node minting incl. AX-duplicate and non-editable filtering; end-to-end fill through a fallback ref).
  • tsc --noEmit clean; dev extension bundle builds with the same keyed extension ID.

Full-tree accessibility snapshots now mint dom_fallback textbox nodes
for textarea, text-like input, and contenteditable elements that never
entered Chrome's debugger-backed accessibility tree, such as framework
pre-hydration composers. The revisioned refs work with the existing
fill, type, and click paths, elements already covered by the
accessibility tree are skipped, and fallback capture failures never
fail the snapshot.

@omp-maintainer omp-maintainer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 — scoped root-cause fix with focused coverage, but two snapshot-boundary defects need correction before merge.
Blocking: the fallback cap is applied before eligibility filtering, and max_nodes/truncated do not account for appended or omitted fallback nodes.
Should-fix: use the repository's #private member convention.
Thanks for the targeted fix.

Comment thread packages/extension/src/browser.ts Outdated
Comment thread packages/extension/src/browser.ts Outdated
Comment thread packages/extension/src/browser.ts Outdated
…dget

- Keep scanning DOM matches until 40 editables are accepted, with a
  separate 400-inspection work bound, so pages whose early matches are
  all accessibility-covered or unsupported still reach a missing
  pre-hydration composer.
- Apply max_nodes to the combined fallback + accessibility result with
  fallback editables leading the list, and report truncated whenever
  either side is omitted.
- Rename the helper to #domEditableFallbackNodes per repository
  convention.
@wolfiesch
wolfiesch merged commit 8343dd8 into main Sep 19, 2026
8 checks passed
@wolfiesch
wolfiesch deleted the dom-fallback-editable-refs branch September 19, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant