Support interacting with Microsoft Loop Components in Microsoft Office products#13617
Merged
Conversation
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.
Link to issue number:
None.
Summary of the issue:
Last year Microsoft announced Microsoft Loop – a new app which combines canvas with portable components that stay in sync and move freely across Microsoft 365 apps. Microsoft Loop: Flexible Canvas App | Microsoft 365. In short, these loop components can be added in emails, teams chats etc. These loop components use WebView2 controls is in visual hosting mode.
When focusing one of these loop components, NVDA stays silent, does not track the focus, and provides no means of interacting with the embedded document.
Steps to reproduce in Microsoft Powerpoint:
NVDA is ignoring events (including focus change events) in this embedded webview2 (Chromium) document as according to Windows the embedded document is never in the foreground, I.e. is not a descendant or, or owned by, the foreground window.
When focus moves inside the Loop component, There is a Chrome_WidgetWin_0 window which gets focus, and this is correctly a descendant of the webview2 control window and in tern the _WwG document in Outlook and therefore a descendant of the foreground window. NVDA does see this at least. But, this Chrome_WidgetWin_0 window has no real content at all.
The actual document content we are interested in is in its own Chrome_RenderWidgetHostHWND window, whose parent window is a Chrome_WidgetWin_1 top-level window. This top-level window is of course not a descendant of the foreground window, nor is it owned by the foreground or a descendant. Thus when NVDA sees events for controls inside this window, they get dropped as they seem to be in the background and not relevant to the user.
Although Microsoft is unwilling to address the underlying issue by ensuring the Chromium document window is either owned by or a descendant of the foreground window, they have at least ensured that the ancestors of the Chromium document in the UIA tree does lead back to the embedding window in the Office document. Thus we can use UIA to detect this and allow the event through.
Description of how this pull request fixes the issue:
eventHandler.shouldAcceptEvent detects this specific scenario and allows the event through.
Specifically:
If the event's window is a background Chrome_RenderWidgetHostHWND, and the win32 focus is on a Chrome_WidgetWin_0 window, and the ancestor chain of the event window's UIA element leads back to a UIA element with a windowHandle matching the Chrome_WidgetWin_0 focused window, then the event is allowed through.
Testing strategy:
Ran the above steps to reproduce. Ensured that NVDA announced the embedded document and the arrow keys could be used to navigate the content in browse mode.
Known issues with pull request:
None known.
Change log entries:
New features
Changes
Bug fixes
For Developers
Code Review Checklist: