Skip to content

fix(a11y): Keep live name updates off name-prohibited roles (backport #25646) (backport #25801) - #25953

Merged
agneszitte merged 4 commits into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-25801
Nov 3, 2026
Merged

agneszitte merged 4 commits into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-25801

Conversation

@mergify

@mergify mergify Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

GitHub Issue: internal

PR Type:

🐞 Bugfix

What changed? 🚀

On WebAssembly with accessibility enabled, a name that changes after its semantic node was created went straight to aria-label, whatever the node's role was. This is common when accessibility is on during app start, because bindings resolve after the tree is built.

  • Standalone text: a TextBlock emitted as a bare <p> kept its original text, and the new text was added as aria-label. A paragraph is named by its content and prohibits aria-label, so the paragraph now gets the new text as its content and no aria-label. createTextElement marks these nodes with data-uno-standalone-text so the update can find them.
  • One role decision: ResolveGenericRole is now the only place that decides the role of a node built by the generic path. Creation, the Name and LandmarkType updates, and the post-layout ScrollViewer check all call it, so a node gets the same role whatever order its name, landmark type and scrollability arrive in. Which nodes the generic path built is recorded at creation. Factory nodes keep their own role: a gridcell used to turn into group on a name change.
    • A named generic node becomes group, and goes back to generic when the name is cleared (WA-01).
    • A region/form landmark that gets its name after creation is now exposed. That includes a TextBlock landmark named by its text.
    • An open dialog keeps the role=dialog set by its focus trap.
    • After layout, a ScrollViewer with an authored landmark such as Navigation keeps it instead of becoming region.
  • Whitespace names: a whitespace-only name no longer counts as a name, at creation or later, because the TS side drops it. This changes creation: a whitespace-named generic node is now created as generic instead of group, and a whitespace-named region, form or scroll region is not exposed.

Tests (Skia WASM):

  • When_Generic_Named_After_Creation_Then_Role_Group
  • When_Standalone_Text_Changes_Then_Paragraph_Text_Updated_Without_AriaLabel
  • When_Generic_Name_Becomes_Whitespace_Then_Role_Generic
  • When_Region_Landmark_Named_After_Creation_Then_Role_Region
  • When_Landmark_TextBlock_Gets_Text_Then_Role_Region
  • When_GridCell_Named_After_Creation_Then_Role_Stays_GridCell
  • When_Standalone_Text_Gets_Name_Then_Paragraph_Has_No_Role
  • Given_AccessibleScrollViewer.When_Navigation_ScrollViewer_Resized_Then_Role_Stays_Navigation
  • Given_AccessibleScrollViewer.When_Whitespace_Named_ScrollViewer_Resized_Then_No_Region

The first two fail without this PR. Each test added during review failed on the PR head that came before its fix. The exception is When_Standalone_Text_Gets_Name_Then_Paragraph_Has_No_Role, which guards the <p> case.

Follow-ups, not in this PR:

  • A live name update on a heading changes only aria-label, so the visible heading text can go stale.
  • Setting or clearing LandmarkType on a factory node writes the role mapped from its control type. For a grid cell that is generic, not gridcell.

PR Checklist ✅

🤖 Generated with Claude Code


This is an automatic backport of pull request #25646 done by [Mergify](https://mergify.com).
This is an automatic backport of pull request #25801 done by [Mergify](https://mergify.com).

morning4coffe-dev and others added 4 commits November 3, 2026 00:32
(cherry picked from commit 36f0b3c)

# Conflicts:
#	src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Automation/Given_WasmAria.cs
(cherry picked from commit 37211a4)
(cherry picked from commit ec781db)

# Conflicts:
#	src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Accessibility/WebAssemblyAccessibility.cs
(cherry picked from commit 16b958a)
(cherry picked from commit 0dfb0e2)

# Conflicts:
#	src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Accessibility/WebAssemblyAccessibility.cs
(cherry picked from commit 05ecc11)
@agneszitte
agneszitte merged commit 778f24f into release/stable/6.7 Nov 3, 2026
17 of 27 checks passed
@agneszitte
agneszitte deleted the mergify/bp/release/stable/6.7/pr-25801 branch November 3, 2026 00:39
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

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.

4 participants