Skip to content

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

Closed
mergify[bot] wants to merge 3 commits into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-25646
Closed

mergify[bot] wants to merge 3 commits into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-25646

Conversation

@mergify

@mergify mergify Bot commented Oct 28, 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).

morning4coffe-dev and others added 3 commits October 28, 2026 21:28
(cherry picked from commit 36f0b3c)

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

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

# Conflicts:
#	src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Accessibility/WebAssemblyAccessibility.cs
@mergify mergify Bot added the conflicts Automated merge hit conflicts label Oct 28, 2026
@mergify

mergify Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of 36f0b3c has failed:

On branch mergify/bp/release/stable/6.7/pr-25646
Your branch is up to date with 'origin/release/stable/6.7'.

You are currently cherry-picking commit 36f0b3c.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Accessibility/WebAssemblyAccessibility.cs
	modified:   src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/Accessibility.ts

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Automation/Given_WasmAria.cs

Cherry-pick of ec781db has failed:

On branch mergify/bp/release/stable/6.7/pr-25646
Your branch is ahead of 'origin/release/stable/6.7' by 1 commit.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit ec781db.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/Accessibility.ts
	modified:   src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/SemanticElements.ts
	modified:   src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Automation/Given_WasmAria.cs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Accessibility/WebAssemblyAccessibility.cs

Cherry-pick of 0dfb0e2 has failed:

On branch mergify/bp/release/stable/6.7/pr-25646
Your branch is ahead of 'origin/release/stable/6.7' by 2 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 0dfb0e2.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Automation/Given_WasmAria.cs
	modified:   src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Automation/Given_AccessibleScrollViewer.cs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Accessibility/WebAssemblyAccessibility.cs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@agneszitte

Copy link
Copy Markdown
Member

Replaced by #25953, a backport of the 6.8 version (#25801), which applies cleanly to release/stable/6.7.

@agneszitte agneszitte closed this Nov 3, 2026
@MartinZikmund
MartinZikmund deleted the mergify/bp/release/stable/6.7/pr-25646 branch November 12, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts Automated merge hit conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants