Repository navigation
fix(a11y): Keep live name updates off name-prohibited roles (backport #25646) - #25801
Conversation
(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
|
Cherry-pick of 36f0b3c has failed: Cherry-pick of ec781db has failed: Cherry-pick of 0dfb0e2 has failed: 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 |
|
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 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): Validation: Skia WASM runtime tests, headless Chrome, locally on b0fef88:
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
@Mergifyio backport release/stable/6.7 |
✅ Backports have been createdDetails
|
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.TextBlockemitted as a bare<p>kept its original text, and the new text was added asaria-label. A paragraph is named by its content and prohibitsaria-label, so the paragraph now gets the new text as its content and noaria-label.createTextElementmarks these nodes withdata-uno-standalone-textso the update can find them.ResolveGenericRoleis 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: agridcellused to turn intogroupon a name change.genericnode becomesgroup, and goes back togenericwhen the name is cleared (WA-01).region/formlandmark that gets its name after creation is now exposed. That includes aTextBlocklandmark named by its text.role=dialogset by its focus trap.Navigationkeeps it instead of becomingregion.genericinstead ofgroup, and a whitespace-named region, form or scroll region is not exposed.Tests (Skia WASM):
When_Generic_Named_After_Creation_Then_Role_GroupWhen_Standalone_Text_Changes_Then_Paragraph_Text_Updated_Without_AriaLabelWhen_Generic_Name_Becomes_Whitespace_Then_Role_GenericWhen_Region_Landmark_Named_After_Creation_Then_Role_RegionWhen_Landmark_TextBlock_Gets_Text_Then_Role_RegionWhen_GridCell_Named_After_Creation_Then_Role_Stays_GridCellWhen_Standalone_Text_Gets_Name_Then_Paragraph_Has_No_RoleGiven_AccessibleScrollViewer.When_Navigation_ScrollViewer_Resized_Then_Role_Stays_NavigationGiven_AccessibleScrollViewer.When_Whitespace_Named_ScrollViewer_Resized_Then_No_RegionThe 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:
aria-label, so the visible heading text can go stale.LandmarkTypeon a factory node writes the role mapped from its control type. For a grid cell that isgeneric, notgridcell.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
This is an automatic backport of pull request #25646 done by [Mergify](https://mergify.com).