fix(a11y-android): a WebView's host is a Group, not a second Document (fixes #521) - #524
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 — sorole:"Document"matched twice per web view.A
Documentwhose only child is aDocumentreporting the same class is the host around the page, and now maps toGroup. Both readers apply it, so onerole: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 aDocument, so the childless-Documentnotice 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
Documentand oneGroupper web view, node counts unchanged (43uiautomator, 36 service), tap andset_valuestill land on the page.Closes #521.