Repository navigation
Breaking changes branch update - #23539
Conversation
Co-authored-by: Copilot <[email protected]>
Adds the 003-wasm-a11y-remediation spec, plan, tasks, research, quickstart, data model, interop contracts, and two runtime-observed findings (NavigationView overflow, aria-label on name-prohibited roles).
Shared (Uno.UI) changes consumed by all Skia targets: - AriaMapper: map AutomationControlType/HeadingLevel/LandmarkType/Orientation to ARIA, derive Name from direct TextBlock content, gate role=region on scrollability + a real name, emit aria-labelledby from LabeledBy, gate aria-roledescription to authored LocalizedControlType only, surface aria-invalid from IsDataValidForForm, and remove an unsubstantiated try/catch in IsScrollable. - AutomationProperties: wire IsDataValidForForm and HeadingLevel change callbacks under #if __SKIA__ so a runtime change reaches assistive tech via NotifyPropertyChangedEvent (both backends consume it: WASM updates aria-invalid/aria-level; Win32 updates UIA_IsDataValidForFormPropertyId / UIA_HeadingLevelPropertyId). - TextBlock: raise a NameProperty PropertyChanged when the accessible name is derived from Text and Text changes at runtime, so the a11y tree re-reads the name (matches WinUI's implicit name re-derivation).
…tree C# bridge that projects the AutomationPeer tree into a parallel semantic DOM next to the canvas: - SemanticElementFactory: create-time appliers for role, name, AutomationId, headings, landmarks, aria-orientation/level/busy/lang, aria-labelledby, aria-invalid, aria-roledescription; empty-attribute suppression. - WebAssemblyAccessibility: tree build/maintenance — realize virtualized items before AOM build, prune Collapsed subtrees, re-emit on Collapsed -> Visible, skip Raw decorative items in virtualized backfill, don't expose Raw virtualized containers as listboxes, expose standalone body text, coalesce nullable role/name at AddSemanticElement, keep role on unnamed main/navigation/search landmarks, order-independent aria-labelledby resolution with backfill (entries kept across drains), gate region/roledescription using the shared AriaMapper heuristics, ComboBox text dedup, ImplicitTextBlock filtering, IsSemanticElement as instance. - WebAssemblyAccessibility.ComboBox: expose the open ComboBox dropdown as an ARIA listbox; suppress duplicate option <p> and dialog Popup nodes. - VirtualizedSemanticRegion: focus the virtualized item's own node, not its ancestor. - FocusSynchronizer: gate WASM tabindex emission to focusables.
TypeScript side of the semantic DOM: - SemanticElements: create the right HTML element per role (button, checkbox, radio, slider, listbox/option, combobox, headings <h1>-<h6> with true aria-level 1-9, landmarks, etc.); emit aria-orientation/level/busy/lang, aria-labelledby, aria-invalid, aria-roledescription, xamlautomationid on factory-path elements; omit empty ARIA attributes on create; don't emit ImplicitTextBlock as standalone body text. - Accessibility: updateAriaLabel/updateAriaInvalid/updateAriaLevel setters; omit empty aria-label in updateAriaLabel; tabindex gated to focusables.
Re-enables DOM-level assertions in the existing suite (Button, CheckBox, ComboBox, ListView, Slider, TextBox) and adds focused coverage: - Given_AccessibleAria: ARIA attribute emission (label/labelledby/roledescription/invalid/orientation/busy/lang), virtualized realization, Collapsed pruning, Collapsed -> Visible re-emit, landmark gating, runtime Name propagation, order-independent labelledby. - Given_AccessibleHeading: HeadingLevel 1-9 tag clamp + true aria-level, live-sync of aria-level. - Given_AccessibleScrollViewer: role=region gated on scrollability + a real name. - Given_AccessibleTabindex: tabindex gated to focusables; AutomationId/role mapping on focusables.
OnAutomationIdChanged on native WASM was setting aria-label from the AutomationId value unconditionally, conflating the programmatic identifier with the accessible name. It also failed to remove a stale role attribute when the AutomationId normalized to null. Drop the bogus aria-label assignment (Name is the only source for that) and explicitly RemoveAttribute(`role`) when no role can be derived. Co-authored-by: Copilot <[email protected]>
… names RaiseAutomationNameChangedIfNeeded raised AutomationPropertyChanged for the Name property whenever the displayed Text changed, even when an explicit LabeledBy was supplying the accessible name. That produced bogus change notifications for assistive tech. Skip the event when LabeledBy is set, and add a secondary guard that only fires when the peer's GetName() actually equals the new text (i.e. Text really is what drives the name). Co-authored-by: Copilot <[email protected]>
… test helpers Each Given_Accessible* file carried its own copy of EnableAccessibilityThroughDom, InvokeBrowserJs, GetSemanticElementId, SemanticElementExists, GetSemanticAttribute, SemanticElementHasAttribute, GetSemanticElementTagName, and GetSemanticInputType. Move them into a single WasmSemanticDomHelper static class (HAS_UNO-gated) and add `using static` to the 10 test files, also gated so WinUI/WinAppSDK runs remain buildable. Co-authored-by: Copilot <[email protected]>
…mber Previously createRadioElement set tabIndex=0 only on a checked radio. A radio group where nothing is initially checked would create no tab stop at all (every radio at -1), so keyboard users could not reach the group to begin with -- violating the APG roving-tabindex pattern. After append, if this focusable, unchecked radio joined a named group that still has no tab stop, promote it to tabIndex=0 so the group is reachable via Tab. Co-authored-by: Copilot <[email protected]>
…update Two attribute-emission paths still wrote empty/whitespace values, leaving `aria-label=` ` ` ` or `xamlautomationid=` ` ` ` on the DOM: - The element-creation path in addSemanticElement emitted aria-label and xamlautomationid for any truthy string, including whitespace-only values; mirror updateAriaLabel by requiring trim().length > 0. - setXamlAutomationId could only set, never clear. Pass an empty value and the attribute stayed with an empty string. Match the updateAriaLabel pattern: set when meaningful, removeAttribute otherwise. Co-authored-by: Copilot <[email protected]>
ContainsRealizedHandle used Dictionary<int, IntPtr>.ContainsValue, which is O(n). On the focus/lookup hot path this scaled poorly with large realized item sets. Track a parallel HashSet<IntPtr> updated alongside _realizedHandles on realize/unrealize/dispose, and route ContainsRealizedHandle through the set for O(1) lookups. Co-authored-by: Copilot <[email protected]>
The using-static import for WasmSemanticDomHelper is gated on HAS_UNO, but the test methods consuming it were gated on __SKIA__. A build that defined __SKIA__ without HAS_UNO would compile the test bodies without the helper import. Align the test-body gate to HAS_UNO to match the helper-import gate (and the helper class's own gate). Co-authored-by: Copilot <[email protected]>
Per FR-020 the accessible name belongs to the control, not the selection. Overwriting aria-label with the selected value (e.g. 'France') destroys the head's name composition (e.g. 'Country') and causes the screen reader to announce the value where the name should be. Drop the UpdateAriaLabel call: the existing aria-activedescendant update points to the selected ComboBoxItem, whose own text the screen reader announces alongside the head's preserved name. aria-valuetext is the correct attribute for reflecting the selected text on the head itself and can be added separately when an editable-combobox UX is needed. Co-authored-by: Copilot <[email protected]>
None of 'dataitem', 'header', or 'appbar' are valid WAI-ARIA role tokens and they get rejected by the accessibility tree (same class of bug we already fixed for 'label'/Text). - DataItem outside a grid has no native ARIA equivalent. - Header maps to HTML <header>'s implicit role (banner/generic), not a literal 'header' token. - AppBar is UWP/macOS terminology. Map all three to null, and drop the AppBar/CommandBar short-circuit that previously hard-emitted 'appbar' ahead of the AutomationControlType switch. Co-authored-by: Copilot <[email protected]>
…oString selected.ToString() yields the type name for non-string item view models, producing nonsense accessible text. Mirror WinUI's selection-text resolution: prefer the value pattern (which honors DisplayMemberPath and item-template-bound value providers), and fall back to ToString only when no value provider is exposed. Co-authored-by: Copilot <[email protected]>
OnItemUnrealized was clearing _realizedHandles[index] unconditionally. If a new item was realized into the same index before the unrealize callback arrived, the index now belonged to a different live handle and the eviction would desync state from the DOM. Only clear the mapping when it still points at the same handle, and always purge the handle from _realizedHandleSet independently so the O(1) membership check stays consistent. Co-authored-by: Copilot <[email protected]>
GetSemanticElementId interpolated the Visual.Handle using the current culture, which could format the long differently than the runtime when tests run under a non-invariant culture. Switch to ToString(CultureInfo.InvariantCulture) so the computed DOM id always matches what the runtime emits. Co-authored-by: Copilot <[email protected]>
Several createXxxElement entry points accept isFocusable for JSImport-signature uniformity but intentionally do not apply it (headings, dataitem/header/appbar landmarks, captions, composite containers). Renaming to _isFocusable makes the intent explicit so future refactors do not accidentally assume the value is being honored. Parameters are bound positionally by JSImport so the rename is a no-op at runtime. Co-authored-by: Copilot <[email protected]>
setAccessKey treated whitespace-only strings as truthy and emitted accesskey with a single space, which is meaningless to assistive tech and can interfere with browser shortcut handling. Mirror the omit-when-empty contract used by updateAriaLabel and setXamlAutomationId: trim, then remove the attribute when empty. Co-authored-by: Copilot <[email protected]>
updateAriaHasPopup and updateLang followed the truthiness shortcut and would emit aria-haspopup with a single space (a malformed token that AT treats as "true") or lang with a single space (invalid per the BCP-47 grammar). Mirror the trim-and-omit contract used by updateAriaLabel, setAccessKey, and setXamlAutomationId so meaningless attributes are never persisted. Co-authored-by: Copilot <[email protected]>
The new DOM-level tests call InvokeBrowserJs many times per test (every attribute read goes through it), and re-resolving the runtime Type and MethodInfo on each call shows up as runner overhead. Move the lookup behind a Lazy<MethodInfo> initializer so we still fail fast on a runtime rename but only pay the resolution cost once per test run. Co-authored-by: Copilot <[email protected]>
The three slider tests for Orientation, Level, and ItemStatus/Culture only verified that AutomationProperties round-tripped, not that the mapping the docstring described actually emitted the right ARIA attribute. The vertical- orientation roundtrip was already covered by a DOM-level test below, so this removes the redundant smoke and folds Level/ItemStatus/Culture into one cross-platform DP roundtrip. Two new SkiaWasm-gated DOM tests assert aria-level, aria-busy, and lang on the live semantic node, matching the existing aria-orientation DOM test pattern, so a regression in the WASM mapping now fails the suite. Co-authored-by: Copilot <[email protected]>
The helper trimmed the input for the empty-string check but then wrote the untrimmed value to the DOM, so attributes could end up with leading or trailing whitespace. Write the trimmed value to match the contract. Co-authored-by: Copilot <[email protected]>
IsComboBoxDropdownPopup previously walked every registered ComboBox on every popup open. Maintain a reverse Popup->ComboBox map populated when the dropdown first opens, with a linear-scan fallback that self-heals the map on first hit for popups created before DropDownOpened fires. Co-authored-by: Copilot <[email protected]>
The parameter previously named `automationId` was misleading: it is the aria-label source, not AutomationProperties.AutomationId (which is passed separately as xamlAutomationId). Rename to `ariaLabel` and write the trimmed value to match setAriaStringAttribute. Co-authored-by: Copilot <[email protected]>
|
Nick Randolph seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Claude finished @MartinZikmund's task in 7m 56s —— View job PR Review
Overall verdict: Approve with minor issues. This is a solid, well-structured batch of changes — the composition animation overhaul (scoped batches, keyframe expression support, shape animations, Counts: 2 medium · 3 nits · 0 blocking Cross-cutting observationsWhat's well done:
Issues found (inline):
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23539/wasm-skia-net9/index.html |
|
The build 219599 did not find any UI Test snapshots differences. |
Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Claude-Session: https://claude.ai/code/session_01NtkGU3jXb6TCqbLjqMjgrW
|
Claude finished @MartinZikmund's task in 6m 51s —— View job PR Review
Overall verdict: Approve with minor issues. This is a solid, well-structured batch of changes — the composition animation overhaul (scoped batches, keyframe expression support, shape animations, New inline findings from this pass: 1 medium · 2 nits Cross-cutting observationsWhat's well done:
New issues found:
Previously flagged issues (from prior review pass) that are still open:
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23539/wasm-skia-net9/index.html |
|
The build 219632 did not find any UI Test snapshots differences. |
…drop"
This reverts commit e7518b8, reversing
changes made to 4990906.
Conflicts:
src/Directory.Build.propsGitHub Issue: closes
PR Type:
What changed? 🚀
PR Checklist ✅
Screenshots Compare Test Runresults.