Commit 2fe04bfc authored by David Tseng's avatar David Tseng Committed by Commit Bot

Remove desktop role usage

The desktop role gets used as the root of the entire automation tree and should not be used elsewhere.

This change adds a comment in the enums file where views authors hopefully look for the list of roles.

Note that in ChromeVox, using the desktop role amounts to a no-op, since ChromeVox only checks desktop role when it asks for a AutomationNode.prototype.root.

TBR=tsepez@chromium.org

Bug: 787101
Change-Id: I9f1b7a7a71f69f43ebc265cf0b61d0b0bdb4249f
Reviewed-on: https://chromium-review.googlesource.com/896557
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534514}
parent fe4ec3f7
...@@ -78,6 +78,12 @@ enum Event { ...@@ -78,6 +78,12 @@ enum Event {
kLast = kValueChanged, kLast = kValueChanged,
}; };
// Explanation:
// The majority of these roles come from the ARIA specification. Reference
// the latest draft for proper usage.
//
// Roles not included by the ARIA specification should be avoided, especially
// internal roles used by the accessibility infrastructure.
enum Role { enum Role {
kNone, kNone,
kAbbr, kAbbr,
...@@ -110,7 +116,7 @@ enum Role { ...@@ -110,7 +116,7 @@ enum Role {
kDescriptionListDetail, kDescriptionListDetail,
kDescriptionList, kDescriptionList,
kDescriptionListTerm, kDescriptionListTerm,
kDesktop, kDesktop, // internal
kDetails, kDetails,
kDialog, kDialog,
kDirectory, kDirectory,
......
...@@ -991,7 +991,7 @@ void AppListView::Layout() { ...@@ -991,7 +991,7 @@ void AppListView::Layout() {
void AppListView::GetAccessibleNodeData(ui::AXNodeData* node_data) { void AppListView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
node_data->SetName(state_announcement_); node_data->SetName(state_announcement_);
node_data->role = ax::mojom::Role::kDesktop; node_data->role = ax::mojom::Role::kAlert;
} }
void AppListView::OnKeyEvent(ui::KeyEvent* event) { void AppListView::OnKeyEvent(ui::KeyEvent* event) {
......
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