Commit d1d89d7d authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Remove ax::mojom::Event::kMenuListItemSelected

The specific event was fired from Blink but never used anywhere else
in the code, because the event can be implicitly generated. Replace it
with a call to MarkDirty and update web tests.

Bug: 699438
AX-Relnotes: N/A
Change-Id: Ic1d3649da6ee4bcf8e8a0935276e7a95f5ea9671
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2440588Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarMike West <mkwst@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813633}
parent f30f098d
...@@ -594,9 +594,6 @@ void WebFrameTestProxy::PostAccessibilityEvent(const ui::AXEvent& event) { ...@@ -594,9 +594,6 @@ void WebFrameTestProxy::PostAccessibilityEvent(const ui::AXEvent& event) {
case ax::mojom::Event::kLocationChanged: case ax::mojom::Event::kLocationChanged:
event_name = "LocationChanged"; event_name = "LocationChanged";
break; break;
case ax::mojom::Event::kMenuListItemSelected:
event_name = "MenuListItemSelected";
break;
case ax::mojom::Event::kMenuListValueChanged: case ax::mojom::Event::kMenuListValueChanged:
event_name = "MenuListValueChanged"; event_name = "MenuListValueChanged";
break; break;
......
...@@ -63,7 +63,6 @@ bool IsEventTypeHandledByAXEventGenerator(ax::mojom::Event event_type) { ...@@ -63,7 +63,6 @@ bool IsEventTypeHandledByAXEventGenerator(ax::mojom::Event event_type) {
case ax::mojom::Event::kMediaStartedPlaying: case ax::mojom::Event::kMediaStartedPlaying:
case ax::mojom::Event::kMediaStoppedPlaying: case ax::mojom::Event::kMediaStoppedPlaying:
case ax::mojom::Event::kMenuEnd: case ax::mojom::Event::kMenuEnd:
case ax::mojom::Event::kMenuListItemSelected:
case ax::mojom::Event::kMenuListValueChanged: case ax::mojom::Event::kMenuListValueChanged:
case ax::mojom::Event::kMenuPopupEnd: case ax::mojom::Event::kMenuPopupEnd:
case ax::mojom::Event::kMenuPopupStart: case ax::mojom::Event::kMenuPopupStart:
......
...@@ -137,15 +137,14 @@ void AXMenuListPopup::DidUpdateActiveOption(int option_index, ...@@ -137,15 +137,14 @@ void AXMenuListPopup::DidUpdateActiveOption(int option_index,
if (old_index != option_index && old_index >= 0 && if (old_index != option_index && old_index >= 0 &&
old_index < static_cast<int>(children_.size())) { old_index < static_cast<int>(children_.size())) {
AXObject* previous_child = children_[old_index].Get(); AXObject* previous_child = children_[old_index].Get();
cache.PostNotification(previous_child, cache.MarkAXObjectDirty(previous_child, false);
ax::mojom::Event::kMenuListItemSelected);
} }
if (option_index >= 0 && option_index < static_cast<int>(children_.size())) { if (option_index >= 0 && option_index < static_cast<int>(children_.size())) {
AXObject* child = children_[option_index].Get(); AXObject* child = children_[option_index].Get();
cache.PostNotification(this, ax::mojom::Event::kChildrenChanged); cache.PostNotification(this, ax::mojom::Event::kChildrenChanged);
cache.PostNotification(this, ax::mojom::Event::kActiveDescendantChanged); cache.PostNotification(this, ax::mojom::Event::kActiveDescendantChanged);
cache.PostNotification(child, ax::mojom::Event::kMenuListItemSelected); cache.MarkAXObjectDirty(child, false);
} }
} }
...@@ -155,7 +154,7 @@ void AXMenuListPopup::DidHide() { ...@@ -155,7 +154,7 @@ void AXMenuListPopup::DidHide() {
cache.PostNotification(this, ax::mojom::Event::kHide); cache.PostNotification(this, ax::mojom::Event::kHide);
if (descendant) { if (descendant) {
cache.PostNotification(this, ax::mojom::Event::kChildrenChanged); cache.PostNotification(this, ax::mojom::Event::kChildrenChanged);
cache.PostNotification(descendant, ax::mojom::Event::kMenuListItemSelected); cache.MarkAXObjectDirty(descendant, false);
} }
} }
......
...@@ -19,7 +19,7 @@ async_test(function(t) ...@@ -19,7 +19,7 @@ async_test(function(t)
assert_equals(element.role, "AXRole: AXMenuListPopup"); assert_equals(element.role, "AXRole: AXMenuListPopup");
++eventCount; ++eventCount;
} }
if (notification == "MenuListItemSelected") { if (notification == "MarkDirty") {
assert_equals(element.role, "AXRole: AXMenuListOption"); assert_equals(element.role, "AXRole: AXMenuListOption");
assert_equals(element.name, "Alicia"); assert_equals(element.name, "Alicia");
++eventCount; ++eventCount;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<script> <script>
async_test((t) => { async_test((t) => {
accessibilityController.setNotificationListener(t.step_func((axnode, type) => { accessibilityController.setNotificationListener(t.step_func((axnode, type) => {
if (type == 'MenuListItemSelected') if (type == 'MarkDirty' && axnode.role == 'AXRole: AXMenuListOption')
t.done(); t.done();
})); }));
var menu = document.getElementById('menu'); var menu = document.getElementById('menu');
...@@ -29,7 +29,7 @@ async_test((t) => { ...@@ -29,7 +29,7 @@ async_test((t) => {
assert_unreached("Did not receive all accessibility notifications"); assert_unreached("Did not receive all accessibility notifications");
t.done(); t.done();
}, 500); }, 500);
}, 'Tests if typing an arrow key dispatches a |MenuListItemSelected| a11y event.'); }, 'Tests if typing an arrow key dispatches an a11y event.');
</script> </script>
</body> </body>
......
...@@ -59,8 +59,6 @@ def GetEnumsFromFile(fullpath): ...@@ -59,8 +59,6 @@ def GetEnumsFromFile(fullpath):
enum_value = CamelToLowerHacker(enum_value[1:]) enum_value = CamelToLowerHacker(enum_value[1:])
if enum_value == 'none' or enum_value == 'last': if enum_value == 'none' or enum_value == 'last':
continue continue
if enum_value == 'active_descendant_changed':
enum_value = 'activedescendantchanged'
enums[enum_name].append(enum_value) enums[enum_name].append(enum_value)
return enums return enums
...@@ -71,7 +69,8 @@ def CheckMatchingEnum(ax_enums, ...@@ -71,7 +69,8 @@ def CheckMatchingEnum(ax_enums,
automation_enum_name, automation_enum_name,
errs, errs,
output_api, output_api,
strict_ordering=False): strict_ordering=False,
allow_extra_destination_enums=False):
if ax_enum_name not in ax_enums: if ax_enum_name not in ax_enums:
errs.append(output_api.PresubmitError( errs.append(output_api.PresubmitError(
'Expected %s to have an enum named %s' % (AX_MOJOM, ax_enum_name))) 'Expected %s to have an enum named %s' % (AX_MOJOM, ax_enum_name)))
...@@ -113,6 +112,7 @@ def CheckMatchingEnum(ax_enums, ...@@ -113,6 +112,7 @@ def CheckMatchingEnum(ax_enums,
automation_enum_name, InitialLowerCamelCase(value), automation_enum_name, InitialLowerCamelCase(value),
AUTOMATION_IDL))) AUTOMATION_IDL)))
# Should be no remaining items # Should be no remaining items
if not allow_extra_destination_enums:
for value in dst: for value in dst:
errs.append(output_api.PresubmitError( errs.append(output_api.PresubmitError(
'Found %s.%s in %s, but did not find %s.%s in %s' % ( 'Found %s.%s in %s, but did not find %s.%s in %s' % (
...@@ -138,7 +138,7 @@ def CheckEnumsMatch(input_api, output_api): ...@@ -138,7 +138,7 @@ def CheckEnumsMatch(input_api, output_api):
CheckMatchingEnum(ax_enums, 'Action', automation_enums, 'ActionType', errs, CheckMatchingEnum(ax_enums, 'Action', automation_enums, 'ActionType', errs,
output_api, strict_ordering=True) output_api, strict_ordering=True)
CheckMatchingEnum(ax_enums, 'Event', automation_enums, 'EventType', errs, CheckMatchingEnum(ax_enums, 'Event', automation_enums, 'EventType', errs,
output_api) output_api, allow_extra_destination_enums=True)
CheckMatchingEnum(ax_enums, 'NameFrom', automation_enums, 'NameFromType', CheckMatchingEnum(ax_enums, 'NameFrom', automation_enums, 'NameFromType',
errs, output_api) errs, output_api)
CheckMatchingEnum(ax_enums, 'DescriptionFrom', automation_enums, CheckMatchingEnum(ax_enums, 'DescriptionFrom', automation_enums,
......
...@@ -75,8 +75,6 @@ const char* ToString(ax::mojom::Event event) { ...@@ -75,8 +75,6 @@ const char* ToString(ax::mojom::Event event) {
return "mediaStoppedPlaying"; return "mediaStoppedPlaying";
case ax::mojom::Event::kMenuEnd: case ax::mojom::Event::kMenuEnd:
return "menuEnd"; return "menuEnd";
case ax::mojom::Event::kMenuListItemSelected:
return "menuListItemSelected";
case ax::mojom::Event::kMenuListValueChanged: case ax::mojom::Event::kMenuListValueChanged:
return "menuListValueChanged"; return "menuListValueChanged";
case ax::mojom::Event::kMenuPopupEnd: case ax::mojom::Event::kMenuPopupEnd:
......
...@@ -57,7 +57,6 @@ enum Event { ...@@ -57,7 +57,6 @@ enum Event {
kMediaStartedPlaying, // Native / Automation kMediaStartedPlaying, // Native / Automation
kMediaStoppedPlaying, // Native / Automation kMediaStoppedPlaying, // Native / Automation
kMenuEnd, // Native / web: menu interaction has ended. kMenuEnd, // Native / web: menu interaction has ended.
kMenuListItemSelected, // Web
kMenuListValueChanged, // Web kMenuListValueChanged, // Web
kMenuPopupEnd, // Native / web: a menu/submenu is hidden/closed. kMenuPopupEnd, // Native / web: a menu/submenu is hidden/closed.
kMenuPopupStart, // Native / web: a menu/submenu is shown/opened. kMenuPopupStart, // Native / web: a menu/submenu is shown/opened.
......
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