Commit eb30bda4 authored by Sumit Sahrawat's avatar Sumit Sahrawat Committed by Commit Bot

Fix state change narration for ImageToggleButton in save password dialog

This PR makes the ImageToggleButton class fire a kCheckedStateChanged
event on state changes instead of kAriaAttributeChanged. This fixes an
issue where NVDA was not announcing the state change.

The kCheckedStateChanged event is also handled in
AXPlatformNodeWin::MojoEventToUIAProperty. We map it to
UIA_ToggleToggleStatePropertyId, which makes Narrator announce the
state changes as well.

Tested locally:

* Narrator works with --enable-experimental-ui-automation.
* NVDA works both with and without the experimental flag.
* MacOS VoiceOver works.

Bug: 1013835
Change-Id: I925aad65925aadc34468651198bed39c2ba8776a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1861915Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Sumit Sahrawat <Sumit.Sahrawat@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#707230}
parent ddc6f8ba
......@@ -6890,6 +6890,8 @@ base::Optional<PROPERTYID> AXPlatformNodeWin::MojoEventToUIAProperty(
switch (event) {
case ax::mojom::Event::kControlsChanged:
return UIA_ControllerForPropertyId;
case ax::mojom::Event::kCheckedStateChanged:
return UIA_ToggleToggleStatePropertyId;
default:
return base::nullopt;
}
......
......@@ -228,7 +228,7 @@ void ToggleImageButton::SetToggled(bool toggled) {
toggled_ = toggled;
SchedulePaint();
NotifyAccessibilityEvent(ax::mojom::Event::kAriaAttributeChanged, true);
NotifyAccessibilityEvent(ax::mojom::Event::kCheckedStateChanged, true);
}
void ToggleImageButton::SetToggledImage(ButtonState image_state,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment