Commit bd6abce2 authored by Kurt Catti-Schmidt's avatar Kurt Catti-Schmidt Committed by Commit Bot

GetUnignoredSelection causes DCHECK in GetManagerForChildTree

GetUnignoredSelection (introduced in crrev.com/c/1691559) introduced a
new selection API built on AXPosition. Exposing AXPosition in such
a broad way revealed limitations of AXPosition on specific
platforms. In particular, ChromeOS doesn't have a
BrowserAccessibilityManager, so workarounds were necessary for selection
to work there.

This DCHECK is another of those exceptions - BrowserAccessibilityManager
isn't available on ChromeOS, so the DCHECK is too aggressive to be a
universal expectation. The callers of the function already handle it
returning nullptr, so it's safe to simply return nullptr if there's
no BrowserAccessibilityManager available instead of DCHECKing.

Bug: 995807
Change-Id: I43d21337ce071045d0653be39e10f5003402675e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1773209
Commit-Queue: Kurt Catti-Schmidt <kschmi@microsoft.com>
Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690956}
parent 12e254e4
...@@ -48,9 +48,13 @@ AXTreeManager* AXTreeManagerMap::GetManagerForChildTree( ...@@ -48,9 +48,13 @@ AXTreeManager* AXTreeManagerMap::GetManagerForChildTree(
AXTreeManager* child_tree_manager = AXTreeManager* child_tree_manager =
AXTreeManagerMap::GetInstance().GetManager(child_tree_id); AXTreeManagerMap::GetInstance().GetManager(child_tree_id);
DCHECK(child_tree_manager && // Some platforms do not use AXTreeManagers, so child trees don't exist in
child_tree_manager->GetParentNodeFromParentTreeAsAXNode()->id() == // the browser process.
parent_node.id()); if (!child_tree_manager)
return nullptr;
DCHECK(child_tree_manager->GetParentNodeFromParentTreeAsAXNode()->id() ==
parent_node.id());
return child_tree_manager; return child_tree_manager;
} }
......
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