Repository navigation
fix(a11y): Skip hidden or detached adds in the WASM semantic tree (backport #24383) - #25759
Merged
agneszitte merged 3 commits intoOct 27, 2026
Merged
Conversation
3 of 5 tasks
agneszitte
approved these changes
Oct 27, 2026
This was referenced Nov 9, 2026
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.
GitHub Issue: closes #
PR Type:
🐞 Bugfix
What changed? 🚀
On Skia for WebAssembly, the accessibility bridge emitted semantic DOM nodes for controls that should not be in the tree, and those nodes carried zero geometry:
UIElement.AddChildraises the accessibility hook even while the subtree is still being constructed (generated XAML builds bottom-up, before the page is attached).WebAssemblyAccessibility.OnChildAddedemitted such children against the semantic root because no live ancestor could be resolved, and nothing re-parented or pruned them once the subtree attached under aCollapsedancestor.Collapsedancestor: the pruning check only inspected the child's ownVisibility.Both produced root-level
0x0nodes (a16x6<button>in Chromium) for controls that are not rendered, which is what an automation or assistive-technology client then reads.OnChildAddednow skips adds whose parent is not in the live tree and outermost adds beneath a Collapsed ancestor; the attach of the subtree root, or the ancestor being shown (pruned-handle re-emit / Visibility re-add), replays the descendants through the existing recursion. Skipped adds are Trace-logged. This mirrors the guard the macOS host already carries and the router-side drop on Skia desktop.Visible controls were already positioned correctly; the new geometry tests pin that as a regression guard.
Behavior change
Controls hosted under a
Collapsedancestor no longer appear in the Skia-WASM accessibility tree while hidden. This is WinUI parity (Collapsed subtrees are absent from UIA) and only removes phantom zero-size nodes, but a client that relied on finding a hidden control byaria-labelwill now get "not found" instead of a0x0node.Tests
Skia-WASM, DOM-level,
Given_AccessibleGeometry: node rect matches XAML bounds for a live add and for a detached-then-attached subtree; a detached-built control lands under its named group's node; no node under a Collapsed ancestor for both orderings, and the node appears with correct bounds once the ancestor is shown. Shared helpers added toWasmSemanticDomHelper(EnsureAccessibilityEnabledAsync,GetSemanticElementRect,GetSemanticParentId).Runtime validation (Skia-WASM, headless Edge): unfixed build 2 pass / 2 fail on the original four tests; live-tree guard alone leaves the live-Collapsed-ancestor test failing; full fix 5/5; whole
Windows_UI_Xaml_Automationnamespace 213 pass / 0 fail / 19 platform skips.Not yet measured
AccessibilityRouter, macOS already has the equivalent guard), so they were not re-run.PR Checklist ✅
Screenshots Compare Test Runresults.This is an automatic backport of pull request #24383 done by [Mergify](https://mergify.com).