Commit 9c799d12 authored by Nektarios Paisios's avatar Nektarios Paisios Committed by Commit Bot

Adds kListGrid to the list of roles that behave like a set

TBR=dmazzoni@chromium.org, aleventhal@chromium.org

Change-Id: I0ec929c7bac23f8a5f5bf3e53d2f4aa38bb35db8
Reviewed-on: https://chromium-review.googlesource.com/c/1361336
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626165}
parent 394d56b8
...@@ -66,6 +66,7 @@ bool IsContainerWithSelectableChildren(const ax::mojom::Role role) { ...@@ -66,6 +66,7 @@ bool IsContainerWithSelectableChildren(const ax::mojom::Role role) {
case ax::mojom::Role::kComboBoxMenuButton: case ax::mojom::Role::kComboBoxMenuButton:
case ax::mojom::Role::kGrid: case ax::mojom::Role::kGrid:
case ax::mojom::Role::kListBox: case ax::mojom::Role::kListBox:
case ax::mojom::Role::kListGrid:
case ax::mojom::Role::kMenu: case ax::mojom::Role::kMenu:
case ax::mojom::Role::kMenuBar: case ax::mojom::Role::kMenuBar:
case ax::mojom::Role::kRadioGroup: case ax::mojom::Role::kRadioGroup:
...@@ -87,6 +88,7 @@ bool IsControl(const ax::mojom::Role role) { ...@@ -87,6 +88,7 @@ bool IsControl(const ax::mojom::Role role) {
case ax::mojom::Role::kComboBoxMenuButton: case ax::mojom::Role::kComboBoxMenuButton:
case ax::mojom::Role::kDisclosureTriangle: case ax::mojom::Role::kDisclosureTriangle:
case ax::mojom::Role::kListBox: case ax::mojom::Role::kListBox:
case ax::mojom::Role::kListGrid:
case ax::mojom::Role::kMenu: case ax::mojom::Role::kMenu:
case ax::mojom::Role::kMenuBar: case ax::mojom::Role::kMenuBar:
case ax::mojom::Role::kMenuButton: case ax::mojom::Role::kMenuButton:
...@@ -200,6 +202,7 @@ bool IsList(const ax::mojom::Role role) { ...@@ -200,6 +202,7 @@ bool IsList(const ax::mojom::Role role) {
case ax::mojom::Role::kDocBibliography: case ax::mojom::Role::kDocBibliography:
case ax::mojom::Role::kList: case ax::mojom::Role::kList:
case ax::mojom::Role::kListBox: case ax::mojom::Role::kListBox:
case ax::mojom::Role::kListGrid:
return true; return true;
default: default:
return false; return false;
...@@ -264,16 +267,29 @@ bool IsRowContainer(const ax::mojom::Role role) { ...@@ -264,16 +267,29 @@ bool IsRowContainer(const ax::mojom::Role role) {
bool IsSetLike(const ax::mojom::Role role) { bool IsSetLike(const ax::mojom::Role role) {
switch (role) { switch (role) {
case ax::mojom::Role::kDescriptionList:
case ax::mojom::Role::kDirectory:
case ax::mojom::Role::kDocBibliography:
case ax::mojom::Role::kFeed: case ax::mojom::Role::kFeed:
case ax::mojom::Role::kList:
case ax::mojom::Role::kGroup: case ax::mojom::Role::kGroup:
case ax::mojom::Role::kList:
case ax::mojom::Role::kListBox:
case ax::mojom::Role::kListGrid:
case ax::mojom::Role::kMenu: case ax::mojom::Role::kMenu:
case ax::mojom::Role::kMenuBar: case ax::mojom::Role::kMenuBar:
case ax::mojom::Role::kTabList:
case ax::mojom::Role::kTree:
case ax::mojom::Role::kListBox:
case ax::mojom::Role::kMenuListPopup: case ax::mojom::Role::kMenuListPopup:
case ax::mojom::Role::kRadioGroup: case ax::mojom::Role::kRadioGroup:
case ax::mojom::Role::kTabList:
case ax::mojom::Role::kTree:
return true;
default:
return false;
}
}
bool IsStaticList(const ax::mojom::Role role) {
switch (role) {
case ax::mojom::Role::kList:
case ax::mojom::Role::kDescriptionList: case ax::mojom::Role::kDescriptionList:
return true; return true;
default: default:
...@@ -374,14 +390,4 @@ bool IsUIASelectable(const ax::mojom::Role role) { ...@@ -374,14 +390,4 @@ bool IsUIASelectable(const ax::mojom::Role role) {
} }
} }
bool IsStaticList(const ax::mojom::Role role) {
switch (role) {
case ax::mojom::Role::kList:
case ax::mojom::Role::kDescriptionList:
return true;
default:
return false;
}
}
} // namespace ui } // namespace ui
...@@ -69,6 +69,9 @@ AX_EXPORT bool IsRowContainer(const ax::mojom::Role role); ...@@ -69,6 +69,9 @@ AX_EXPORT bool IsRowContainer(const ax::mojom::Role role);
// can hold set_size values. // can hold set_size values.
AX_EXPORT bool IsSetLike(const ax::mojom::Role role); AX_EXPORT bool IsSetLike(const ax::mojom::Role role);
// Returns true if the provided role belongs to a non-interactive list.
AX_EXPORT bool IsStaticList(const ax::mojom::Role role);
// Returns true if the provided role belongs to a table header. // Returns true if the provided role belongs to a table header.
AX_EXPORT bool IsTableHeader(ax::mojom::Role role); AX_EXPORT bool IsTableHeader(ax::mojom::Role role);
...@@ -91,8 +94,6 @@ AX_EXPORT bool SupportsToggle(const ax::mojom::Role role); ...@@ -91,8 +94,6 @@ AX_EXPORT bool SupportsToggle(const ax::mojom::Role role);
// Automation. // Automation.
AX_EXPORT bool IsUIASelectable(const ax::mojom::Role role); AX_EXPORT bool IsUIASelectable(const ax::mojom::Role role);
AX_EXPORT bool IsStaticList(const ax::mojom::Role role);
} // namespace ui } // namespace ui
#endif // UI_ACCESSIBILITY_AX_ROLE_PROPERTIES_H_ #endif // UI_ACCESSIBILITY_AX_ROLE_PROPERTIES_H_
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