Skip to content

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

Merged
ajpinedam merged 3 commits into
masterfrom
dev/doti/wasm-a11y-tree-structure
Oct 28, 2026
Merged

ajpinedam merged 3 commits into
masterfrom
dev/doti/wasm-a11y-tree-structure

Conversation

@morning4coffe-dev

@morning4coffe-dev morning4coffe-dev commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

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

Copilot AI balanced review requested due to automatic review settings October 22, 2026 20:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@github-actions github-actions Bot added the platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform label Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @morning4coffe-dev's task in 18s —— View job


Review summary

Verdict: Looks good overall, with minor fixes suggested. I reviewed by inspection only and did not build or run the tests.

  • Issues: 0 high, 1 medium, 1 low (both inline).
  • The live-name generic↔group handling matches the creation path.
  • The two new runtime tests cover the stated regressions.

@unodevops

Copy link
Copy Markdown
Contributor

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

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 240875 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • ClipboardTests.png-dark
    • DisplayInformation.png-dark
    • DropDownButtonPage.png-dark
    • Examples.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
  • skia-windows-screenshots: 2458 changed over 2490

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png-dark
    • AppBarButtonTest.png-dark
    • AppBarToggleButtonTest.png-dark
    • ApplicationViewSizing.png-dark
    • AppWindowClosing.png-dark
    • AppWindowPresenters.png-dark
    • ArcSegment.png-dark
    • Attributed_text_Simple.png
    • AuthenticationBroker_Demo.png
    • AutoBorderStretchwithbottommargin.png-dark
    • AutomationProperties_Landmark.png
    • AutomationProperties_Name.png-dark
    • AutoSuggestBoxChosenSuggestion.png-dark
    • AutoSuggestBoxChosenSuggestion.png
    • BackGesture.png-dark
    • BackGesture.png
    • BasicEnability.png-dark
    • BasicEnability.png
    • BeginTime_MultipleAnimations.png-dark
    • BeginTime_MultipleAnimations.png

@agneszitte

Copy link
Copy Markdown
Member

@Mergifyio backport servicing/6.8 release/stable/6.7

@mergify

mergify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

backport servicing/6.8 release/stable/6.7

✅ Backports have been created

Details

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

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

Copilot AI balanced review requested due to automatic review settings October 28, 2026 17:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @ajpinedam's task in 34s —— View job


Review summary

Verdict: Looks good. I found nothing that blocks merge. I reviewed by inspection only. I did not build or run any tests, so nothing here is compile or runtime validation.

  • Issues: 0 high, 0 medium, 1 low (below).
  • Earlier review feedback is addressed by the current head (ec781db4):
    • Role resolution is now one helper, ResolveGenericRole. Creation, the Name handler and the LandmarkType handler all call it, so a node gets the same role whichever order its state arrives in.
    • Named region/form landmarks now get their role when the name arrives late.
    • "Has a name" now uses the resolved label with whitespace trimming. That matches what the TS side does.
    • Standalone text is detected by a data-uno-standalone-text marker instead of the P/SPAN tag name.
    • The stray BOM on Given_WasmAria.cs is gone.
  • Scroll-region gating: hasAccessibleName && peer is not null && IsScrollable is equivalent to QualifiesAsNamedScrollRegion. The only difference is that it reuses the already-resolved name, so I see no behaviour change.

Low / non-blocking:

  • OnAutomationNameChanged calls IsGenericPathNode, which runs GetSemanticElementType, on every name change. TextBlock.Text changes are the common case, and those are cut off by the Text check. Other control types still pay the cost. That's fine for now, but keep an eye on it if a11y-enabled profiling shows it.
  • Out of scope, noted by an earlier reviewer: headings set both textContent and aria-label at creation, but a live update only changes aria-label. The visible heading text can go stale.
    · branch dev/doti/wasm-a11y-tree-structure

@ajpinedam

Copy link
Copy Markdown
Contributor

Also fixed in ec781db: on the previous head, any name change on a DataGrid cell (a Custom peer with GridItem, created as role=gridcell) turned it into role=group. Name changes now only re-resolve the role of nodes that came from the generic path. An open ContentDialog also keeps the role=dialog that FocusTrap sets. When_GridCell_Named_After_Creation_Then_Role_Stays_GridCell covers the gridcell case.

@Xiaoy312 Xiaoy312 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, all five earlier points are addressed, and having one ResolveGenericRole used by creation and both live handlers is a good shape. A few follow-ups are inline.

The PR description is now stale. It lists only the first two tests and doesn't mention:

  • ResolveGenericRole, now shared by creation and both live handlers
  • the named-region landmark case
  • that the open dialog's role is preserved
  • the creation-time change from IsNullOrEmpty to IsNullOrWhiteSpace. A whitespace-named generic is now created as generic instead of group, and a whitespace-named region/form is no longer exposed.

@unodevops

Copy link
Copy Markdown
Contributor

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

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 242016 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png-dark
    • ButtonClippingTestsControl.png-dark
    • Buttons.png
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DisplayInformation.png-dark
    • DropDownButtonPage.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Examples.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • ImageBrushAlignmentXY.png-dark
    • ImageBrushAlignmentXY.png
  • skia-windows-screenshots: 2458 changed over 2492

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png-dark
    • AnimatedIconPage.png-dark
    • AppBarButtonTest.png
    • AppBar_KeyBoard.png-dark
    • ApplicationViewSpanningRectsPage.png-dark
    • AppWindowFeatures.png-dark
    • AppWindowTitleBar Properties.png
    • Attributed_text_FontSize_Changing.png-dark
    • Attributed_text_Supserscript.png-dark
    • Attributed_text_Supserscript.png
    • AutoBorderStretchwithtopmargin.png
    • AutomationPropertiesExtensions_Role.png-dark
    • AutoSizedTopLeft.png
    • AutoSuggestBoxChosenSuggestion.png-dark
    • AutoSuggestBox_Reason.png-dark
    • AutoSuggestBox_Reason.png
    • BasicEnability.png-dark
    • BasicEnability.png
    • BeginTime_MultipleAnimations.png-dark
    • BeginTime_MultipleAnimations.png

Copilot AI balanced review requested due to automatic review settings October 28, 2026 20:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @ajpinedam's task in 24s —— View job


Review summary

Verdict: Looks good. Nothing blocks merge. I reviewed by inspection only (Code review). I did not build or run any tests, so there is no compile or runtime validation here.

I reviewed the latest head commit 0dfb0e2f, "Record generic-path nodes at creation". I did not re-review the earlier commits.

Issues: 0 high, 0 medium, 1 low.

  • Earlier feedback is addressed.
    • Xiaoy312's TextBlock/landmark case is fixed. The TextBlock + LandmarkType=Custom + empty Text node goes down the generic path at creation. Its handle is recorded, so a later name change re-resolves its role. The Text control-type special case and the repeated GetSemanticElementType call are gone.
    • TryUpdateScrollRegionRole now goes through ResolveGenericRole, so the post-layout scroll check no longer decides the role separately.
  • _genericPathHandles lifecycle: It is added to in the creation path, which only runs when result is true. It is cleared on child removal, on the full reset at ~L1087, and on the teardown at ~L2860. I found no other place where a node is destroyed without cleanup.

Low / non-blocking:

  • The _prunedHandles removal at ~L810 is a separate lifecycle from _genericPathHandles. That is fine, because a pruned node that is later shown goes through creation again, which re-adds its handle. If a node is ever re-created in place without going through RemoveSemanticElement, the stale entry could point at a factory-built node. I found no such path today.

Cross-cutting:

  • Xiaoy312 noted that the PR description is stale. It still lists only the first two tests. It does not mention ResolveGenericRole, the late-named region case, the dialog role being preserved, or the IsNullOrWhiteSpace change at creation. Please update it before merge.
  • The remaining out-of-scope items are already acknowledged: stale heading textContent on live updates, and LandmarkType clobbering gridcell on factory nodes.
    · branch dev/doti/wasm-a11y-tree-structure

@unodevops

Copy link
Copy Markdown
Contributor

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

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 242060 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DisplayInformation.png-dark
    • DynamicFont.png-dark
    • DynamicFont.png
    • Examples.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • DropDownButtonPage.png-dark
    • ImageBrushAlignmentXY.png-dark
    • ImageBrushAlignmentXY.png
  • skia-windows-screenshots: 2458 changed over 2492

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png
    • AnimatedVisualsTestbedPage.png-dark
    • AppBarToggleButtonTest.png
    • ApplicationViewSpanningRectsPage.png-dark
    • AppWindowFeatures.png-dark
    • AppWindowTitleBar Properties.png
    • Arrange_Performance01.png-dark
    • Attributed_text_Supserscript.png-dark
    • AutoBorderStretchwithleftmargin.png
    • AutoBorderStretchwithrightmargin.png-dark
    • AutomationProperties_Name.png
    • AutomationProperties_Relations.png-dark
    • AutoSuggestBox_Description.png-dark
    • AutoSuggestBox_Description.png
    • AutoSuggestBox_SoftKeboard.png-dark
    • AutoSuggestBox_SoftKeboard.png
    • Basics_Automated.png-dark
    • Basics_Automated.png
    • BeginTime_MultipleAnimations.png-dark
    • BeginTime_MultipleAnimations.png

@mergify

mergify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@ajpinedam
ajpinedam merged commit 4744356 into master Oct 28, 2026
51 checks passed
@ajpinedam
ajpinedam deleted the dev/doti/wasm-a11y-tree-structure branch October 28, 2026 21:27
ajpinedam added a commit that referenced this pull request Oct 30, 2026
…r-25646

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

platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants