Commit 787230f4 authored by Randy Rossi's avatar Randy Rossi Committed by Commit Bot

Only cache scopes route node if names route node found

This CL fixes an issue that was causing the screen
reader to unnecessarily re-focus when a node with
scopes route flag was found without any descendant
names route node.  This caused the scopes route node
to be added to the cache but then immediately removed
by the check for empty scopes route.  That causes
a refocus.

Bug: None
Test: Manual w/ display assistant, unit tests
Change-Id: Idbafc1cff79150d8be7f790612d342cd674d16e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2525771Reviewed-by: default avatarRyan Daum <rdaum@chromium.org>
Commit-Queue: Randy Rossi <rmrossi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825448}
parent 6e0d513c
......@@ -643,11 +643,13 @@ void AXTreeSourceFlutter::HandleRoutes(std::vector<ui::AXEvent>* events) {
continue;
}
scopes_route_cache_.push_back(node->GetId());
// Find a node in the sub-tree with names route flag set.
FlutterSemanticsNode* sub_node = FindRoutesNode(node);
if (sub_node) {
// Only register the scopes route node in our cache
// if a names route is found.
scopes_route_cache_.push_back(node->GetId());
ui::AXNodeData data;
SerializeNode(sub_node, &data);
std::string name;
......
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