Commit 420f236e authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Pass accessible name tests for tree view

This is split out from the CL to test all widgets and views for nameless
focusable objects. See crrev.com/c/951933.

Bug: 819350
Change-Id: Iae8c931231d6516cb64abe6386b4c3e343b9870c
Reviewed-on: https://chromium-review.googlesource.com/952329Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541777}
parent 152150a4
......@@ -427,8 +427,16 @@ void TreeView::ShowContextMenu(const gfx::Point& p,
void TreeView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
node_data->role = ax::mojom::Role::kTree;
node_data->SetRestriction(ax::mojom::Restriction::kReadOnly);
if (!selected_node_)
// TODO(aleventhal): The tree view accessibility implementation is misusing
// the name field. It should really be using selection events for the
// currently selected item. The name field should be for for the label
// if there is one, otherwise something that would work in place of a label.
// See http://crbug.com/811277.
if (!selected_node_) {
node_data->SetNameExplicitlyEmpty();
return;
}
// Get selected item info.
node_data->role = ax::mojom::Role::kTreeItem;
......
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