-
Notifications
You must be signed in to change notification settings - Fork 6k
Win32 a11y bridge and platform node delegates #29829
Conversation
| gfx::NativeViewAccessible root_iaccessible = GetNativeViewAccessible(); | ||
| if (root_iaccessible) { | ||
| LresultFromObject(IID_IAccessible, wparam, root_iaccessible); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to actively attach the root accessibility node to the view?
The first time this method is called root_iaccessible will be null because the update will only come after one frame delay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, Is this also how chromium listens to the accessibility services?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how the root accessibility node is attached to the view.
When Windows wants the accessibility node associated with the HWND it fires a WM_GETOBJECT event into the main event loop, which we then handle in this method. We look up the root AXPlatformNodeWin (which implements IAccessible) above in GetNativeViewAccessible() and return it via LresultFromObject() here.
| [](const FlutterSemanticsCustomAction* action, void* user_data) { | ||
| auto host = static_cast<FlutterWindowsEngine*>(user_data); | ||
| if (!action || action->id == kFlutterSemanticsNodeIdBatchEnd) { | ||
| host->accessibility_bridge_->CommitUpdates(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to attach root accessibility node to the view as well, this will be the first time the accessibility tree is avaliable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replied above about how attaching the root node is done via WM_GETOBJECT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good
|
I understand this is only part of the patch, but since it is already hooked up to the flutter engine, we should have a simple test to just make sure the thing doesn't crash. Maybe just some test to make sure you can turn semantics on and off and receive some update without crashing the test |
This is the third in a series of patches adding accessibility support for the Windows embedder. This patch wires in the Accessibility bridge, and lands the core structure of the Windows FlutterPlatformNodeDelegate and AccessibilityBridgeDelegate classes, including: * Instantiating the AccessibilityBridge when the semantics tree is enabled. * Creating FlutterPlatformNodeDelegate wrappers for semantics tree nodes. * Building and updating the accessibility tree on semantics updates. * Returning the native IAccessible objects when queried. Breaking this out so that the follow-up patches can be reviewed and landed in smaller, independent chunks. Issue: flutter/flutter#77838
There's nothing to do here.
Verify that a windows IAccessible COM object is generated.
Added. |
chunhtai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I didn't test it locally since i don't have a device, but the wiring logic looks good
| void FlutterPlatformNodeDelegateWin32::Init(std::weak_ptr<OwnerBridge> bridge, | ||
| ui::AXNode* node) { | ||
| FlutterPlatformNodeDelegate::Init(bridge, node); | ||
| ax_platform_node_ = ui::AXPlatformNode::Create(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the fragment root created? Is it in a later patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fragment roots are only needed if we implement UIA, which is the newer a11y API. Talked to @clarkezone who mentioned we're safe with sticking with MSAA for the time being.
| [](const FlutterSemanticsCustomAction* action, void* user_data) { | ||
| auto host = static_cast<FlutterWindowsEngine*>(user_data); | ||
| if (!action || action->id == kFlutterSemanticsNodeIdBatchEnd) { | ||
| host->accessibility_bridge_->CommitUpdates(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good
This is the third in a series of patches adding accessibility support
for the Windows embedder. This patch wires in the Accessibility bridge,
and lands the core structure of the Windows FlutterPlatformNodeDelegate
and AccessibilityBridgeDelegate classes, including:
enabled.
nodes.
priority, but required if we don't want to break the UWP build.
Breaking this out so that the follow-up patches can be reviewed and
landed in smaller, independent chunks.
Issue: flutter/flutter#77838
Issue: flutter/flutter#93928
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.