Skip to content

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

Merged
ajpinedam merged 4 commits into
servicing/6.8from
mergify/bp/servicing/6.8/pr-25646
Oct 30, 2026
Merged

ajpinedam merged 4 commits into
servicing/6.8from
mergify/bp/servicing/6.8/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/servicing/6.8/pr-25646
Your branch is up to date with 'origin/servicing/6.8'.

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/servicing/6.8/pr-25646
Your branch is ahead of 'origin/servicing/6.8' 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/servicing/6.8/pr-25646
Your branch is ahead of 'origin/servicing/6.8' 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

@ajpinedam

Copy link
Copy Markdown
Contributor

Resolved the cherry-pick conflicts with one commit (b0fef88) on top of Mergify's three (no history rewrite).

Why it conflicted: #25646 rewrites role logic in WebAssemblyAccessibility.cs that came to master with #23722 (feat(a11y): WinUI-parity accessibility fixes for Skia, merged after the 6.8 fork and never backported). Its tests extend Given_WasmAria.cs, a file that #23722 also added. Mergify's conflicted commits deleted WebAssemblyAccessibility.cs outright and added a partial master Given_WasmAria.cs, which brought #23722's tests along. That is why the build failed.

Missing prerequisite backport: #23722 is not on 6.8. It is a 56-file feature, and even with it applied the cherry-pick still conflicts on code from later master-only accessibility PRs. So this is a hand port onto 6.8's code rather than a prerequisite backport.

What the fix commit does:

Tests not carried (they assert #23722's WA-01 rule, which 6.8 does not have): When_Generic_Named_After_Creation_Then_Role_Group, When_Generic_Name_Becomes_Whitespace_Then_Role_Generic.

Validation: Skia WASM runtime tests, headless Chrome, locally on b0fef88:

  • Given_AccessibleAria + Given_AccessibleScrollViewer: 42/42 passed, including the 7 new tests.
  • The whole Windows_UI_Xaml_Automation namespace: 224 passed, 0 failed (20 skipped by platform condition).
  • Negative control (6.8 base runtime, new tests kept): 6 of the 7 new tests fail. When_GridCell_Named_After_Creation_Then_Role_Stays_GridCell passes there too; it guards a regression from an intermediate head of fix(a11y): Keep live name updates off name-prohibited roles #25646 that 6.8 never had.

@unodevops

Copy link
Copy Markdown
Contributor

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

@ajpinedam
ajpinedam merged commit 69571d1 into servicing/6.8 Oct 30, 2026
42 checks passed
@ajpinedam
ajpinedam deleted the mergify/bp/servicing/6.8/pr-25646 branch October 30, 2026 11:36
@agneszitte

Copy link
Copy Markdown
Member

@Mergifyio backport release/stable/6.7

@mergify

mergify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

backport release/stable/6.7

✅ Backports have been created

Details

agneszitte added a commit that referenced this pull request Nov 3, 2026
…6.7/pr-25801

fix(a11y): Keep live name updates off name-prohibited roles (backport #25646) (backport #25801)
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.

4 participants