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 [https://github.com//issues/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

facebook::react::Point pt,
facebook::react::Point &localPt,
bool ignorePointerEvents) const noexcept {
facebook::react::Point ptLocal{pt.x - m_layoutMetrics.frame.origin.x, pt.y - m_layoutMetrics.frame.origin.y};
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible there's a scale or other transform that needs to be applied?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is a valid concern. The hitTest method should consider the scale/transform. Looking at the ViewComponentView::hitTest implementation, it correctly handles the origin offset

facebook::react::Point ptLocal{pt.x - m_layoutMetrics.frame.origin.x, pt.y - m_layoutMetrics.frame.origin.y};

// 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,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this function ("hitTest") only called for UIA, or can it be called for other reasons?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hitTest is called for multiple purposes, not just UIA:

  1. UIA/Accessibility via RootComponentView::UiaProviderFromPoint
  2. Pointer/Touch Events via CompositionEventHandler
  3. Focus Navigation:

@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

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.

3 participants