Skip to content

fix(a11y-android): a WebView's host is a Group, not a second Document (fixes #521) - #524

Merged
xxx merged 1 commit into
masterfrom
web-host-is-a-group
Aug 25, 2026
Merged

fix(a11y-android): a WebView's host is a Group, not a second Document (fixes #521)#524
xxx merged 1 commit into
masterfrom
web-host-is-a-group

Conversation

@xxx

@xxx xxx commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

An Android WebView published its page as two nested Documents — the host view, and the page root the engine puts inside it, which reports the host's own class — so role:"Document" matched twice per web view.

A Document whose only child is a Document reporting the same class is the host around the page, and now maps to Group. Both readers apply it, so one role: selector addresses a page on either. No node is dropped and no id moves, and a WebView that has published no page root yet stays a Document, so the childless-Document notice still names it.

Bounds are deliberately not part of the test: on the reading this came from, the host is 2062px tall and the page root inside it 2064, so a same-rect condition would never have fired.

Read back on an API 34 emulator through both readers — one Document and one Group per web view, node counts unchanged (43 uiautomator, 36 service), tap and set_value still land on the page.

Closes #521.

…fixes #521)

A web engine gives the page root it publishes the host view's own class, so
both nodes reported android.webkit.WebView and every web view arrived as two
nested Documents — role:"Document" matched twice per page.

A Document whose only child is a Document reporting the same class is the host
view around the page, and now maps to Group. Both readers apply it, so one
role: selector addresses a page on either. Nothing is dropped or renumbered,
and a WebView that has published no page root stays a Document so the
childless-Document notice still names it.

Read back on an API 34 emulator, both readers: one Document and one Group per
web view, node counts unchanged (43 uiautomator, 36 service), tap and
set_value still land on the page.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@xxx
xxx marked this pull request as ready for review August 25, 2026 16:22
@xxx
xxx merged commit ce2296c into master Aug 25, 2026
17 checks passed
@xxx
xxx deleted the web-host-is-a-group branch August 25, 2026 16:32
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.

android a11y: a WebView reads as two nested Documents (host view + page root)

1 participant