Commit 816160a3 authored by Nektarios Paisios's avatar Nektarios Paisios Committed by Chromium LUCI CQ

Implements a predicate for finding window-like containers

When an AXTree of Views is added to the existing forest of accessibility trees,
and when AXPosition starts being used more on Chrome OS,
we'll need a way to determine if a particular node is at the root of
a window-like container, in order to be able to easily jump to
its beginning or its end.
Window-like containers include webpages, PDFs, browser windows, the App List,
and the whole desktop.

AX-Relnotes: n/a.

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

Change-Id: Ic0d0d36d9aba80e50b171d82e8fc97215a4b1694
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575259
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837458}
parent 0592a5f8
......@@ -481,6 +481,19 @@ bool IsReadOnlySupported(const ax::mojom::Role role) {
}
}
bool IsRootLike(ax::mojom::Role role) {
if (IsDialog(role) || IsPlatformDocument(role))
return true;
switch (role) {
case ax::mojom::Role::kDesktop:
case ax::mojom::Role::kWindow:
return true;
default:
return false;
}
}
bool IsRowContainer(const ax::mojom::Role role) {
switch (role) {
case ax::mojom::Role::kGrid:
......
......@@ -129,6 +129,11 @@ AX_BASE_EXPORT bool IsRangeValueSupported(const ax::mojom::Role role);
// ARIA-1.1+ role='grid' or 'treegrid', and not role='table'.
AX_BASE_EXPORT bool IsReadOnlySupported(const ax::mojom::Role role);
// Returns true if the provided role is at the root of a window-like container,
// (AKA a widget in Views terminology), such as the root of the web contents, a
// window, a dialog or the whole desktop.
AX_BASE_EXPORT bool IsRootLike(ax::mojom::Role role);
// Returns true if the provided role belongs to a widget that can contain a
// table or grid row.
AX_BASE_EXPORT bool IsRowContainer(const ax::mojom::Role role);
......
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