Skip to content

Conversation

@protikbiswas100
Copy link
Contributor

@protikbiswas100 protikbiswas100 commented Dec 9, 2025

Description

Accessibility and UIA Support for XAML Fabric implementation

Type of Change

  • New feature (non-breaking change which adds functionality)

Why

To ensure Accessibility props are read in Accessibility Insights.

Resolves #15325

What

Override hitTest in ContentIslandComponentView to properly handle hit testing for content inside the ChildSiteLink/ContentIsland. The method is checking if the point is within the ContentIslandComponentView's bounds
If yes, return the tag of the ContentIslandComponentView itself (or the tag that represents it properly)
This allows the accessibility tree to properly identify the container of the XAML content

Screenshots & Testing

xaml.mp4

Changelog

Should this change be included in the release notes: yes

Add a brief summary of the change to use in the release notes for the next release.
Accessibility and UIA Support for XAML Fabric implementation

Microsoft Reviewers: Open in CodeFlow

@protikbiswas100 protikbiswas100 requested a review from a team as a code owner December 9, 2025 04:02
@protikbiswas100 protikbiswas100 marked this pull request as draft December 9, 2025 04:02
@protikbiswas100
Copy link
Contributor Author

/azp run PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@protikbiswas100
Copy link
Contributor Author

/azp run PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@protikbiswas100 protikbiswas100 marked this pull request as ready for review December 12, 2025 05:59
@protikbiswas100 protikbiswas100 changed the title User/protikbiswas100/15325 accessibility Accessibility and UIA Support for XAML Fabric implementation Dec 12, 2025
Copy link
Contributor

@iamAbhi-916 iamAbhi-916 left a comment

Choose a reason for hiding this comment

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

lgtm
but one thing we are not traversing into children, thats intentional? ContentIslandComponentView this will be the boundary

@protikbiswas100
Copy link
Contributor Author

/azp run PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@protikbiswas100
Copy link
Contributor Author

lgtm but one thing we are not traversing into children, thats intentional? ContentIslandComponentView this will be the boundary

Yes, this is intentional and correct. Here's why:

  1. ContentIslandComponentView is a Boundary: ContentIslandComponentView hosts a separate ContentIsland with its own XAML tree
  2. XAML Hit Testing Happens Separately: The UIA hit test delegates to the XAML tree via ElementProviderFromPoint

Copy link
Contributor

@sundaramramaswamy sundaramramaswamy left a comment

Choose a reason for hiding this comment

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

Approved with comments.

// Check if the point is within the bounds of this ContentIslandComponentView.
// This ensures that hit tests correctly return this view's tag for UIA purposes,
// even when the actual content (XAML buttons, etc.) is hosted in the ContentIsland.
auto props = viewProps();
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefer const auto props = viewProps().

When declaring a variable in C++, almost always default to const T var = value. Drop const only if you know you're going to write to it. Why? Refer What is “const correctness”?.

props->pointerEvents == facebook::react::PointerEventsMode::BoxOnly) &&
ptLocal.x >= 0 && ptLocal.x <= m_layoutMetrics.frame.size.width && ptLocal.y >= 0 &&
ptLocal.y <= m_layoutMetrics.frame.size.height) {
localPt = ptLocal;
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly named variables should usually be avoided. They are hard to understand for readers. Consider renaming ptLocal to something else.

@protikbiswas100 protikbiswas100 merged commit 387c058 into microsoft:main Dec 18, 2025
30 checks passed
@protikbiswas100 protikbiswas100 deleted the user/protikbiswas100/15325-accessibility branch December 18, 2025 04:55
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.

Accessibility and UIA Support

4 participants