Repository navigation
fix: keep window content view from blocking accessibility hit-tests - #56093
Open
rafa11rodrigues wants to merge 1 commit into
Open
rafa11rodrigues wants to merge 1 commit into
rafa11rodrigues wants to merge 1 commit into
Conversation
BrowserWindow places its WebContentsView as a sibling of the window content view, below it in the paint order, so that views added to the content view are painted on top of the web content. The content view covers the whole window, so the default bounds check made it win every hit-test: ViewAXPlatformNodeDelegate::HitTestSync returned the empty container instead of the web content, which broke screen reader mouse tracking (electron#42945). 1. Install ContentViewTargeterDelegate on Windows and Linux (matching macOS behavior) so that the content view only intercepts points covered by its child views, allowing accessibility hit-tests and mouse targeting to fall through to the WebContentsView. 2. Keep the content view out of the accessibility tree while it has no visible children (SetHideFromAccessibilityWhenChildless), updating its ignored state dynamically when child views are added, removed, or change visibility. 3. Add unit test coverage in spec/api-view.spec.ts for child view management on the window content view. Fixes electron#42945. Co-authored-by: wittjeff <[email protected]> Co-authored-by: Raphael Fougeroux <[email protected]>
4 of 6 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
This PR resolves an accessibility regression (#42945) where screen readers (NVDA, JAWS) fail to perform mouse tracking / mouse echo over web content on Windows and Linux starting in Electron 30.
This continues and addresses maintainer review feedback from #55334 (and originally #53460):
ContentViewTargeterDelegateon Windows and Linux (matching macOS behavior inNativeWindowMac), allowing accessibility hit-tests and mouse targeting to fall through toWebContentsViewunless covered by an actual child view.contentViewout of the accessibility tree when childless (SetHideFromAccessibilityWhenChildless(true)), dynamically updating its ignored state when children are added, removed, or made visible/invisible.docs/developmenttospec/api-view.spec.tsin accordance with testing guidelines.Fixes #42945.
Checklist
fix: ...)Release Notes
Notes: Fixed an issue where the window content view blocked accessibility hit-testing on Windows and Linux.