// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_ACCESSIBILITY_AX_ROLE_PROPERTIES_H_ #define UI_ACCESSIBILITY_AX_ROLE_PROPERTIES_H_ #include "ui/accessibility/ax_base_export.h" #include "ui/accessibility/ax_enums.mojom-forward.h" namespace ui { // This file contains various helper functions that determine whether a // specific accessibility role meets certain criteria. // // Please keep these functions in alphabetic order. // When using these functions in Blink, it's necessary to add the function names // to third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py, in // order to pass presubmit. // Returns true for text parents that can have inline text box children. AX_BASE_EXPORT bool CanHaveInlineTextBoxChildren(ax::mojom::Role role); // Returns true for object roles that have the attribute "Children // Presentational: True" as defined in the ARIA Specification. // https://www.w3.org/TR/wai-aria-1.1/#childrenArePresentational. AX_BASE_EXPORT bool HasPresentationalChildren(const ax::mojom::Role role); // Returns true if the given role is an alert or alert-dialog type. AX_BASE_EXPORT bool IsAlert(const ax::mojom::Role role); // Returns true if the given role is a candidate to be labeled with a classname // of TextView on Android. AX_BASE_EXPORT bool IsAndroidTextViewCandidate(const ax::mojom::Role role); // Returns true if the provided role belongs to a native or an ARIA button. AX_BASE_EXPORT bool IsButton(const ax::mojom::Role role); // Returns true if the provided role belongs to a cell or a table header. AX_BASE_EXPORT bool IsCellOrTableHeader(const ax::mojom::Role role); // Returns true if the role is expected to be the parent of a child tree. // Can return false for a child tree owner if an ARIA role was used, e.g. //