chromium/third_party/blink/renderer/modules/accessibility/ax_object.cc

/*
 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1.  Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 * 2.  Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
 *     its contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/modules/accessibility/ax_object.h"

#include <algorithm>
#include <ostream>

#include "base/auto_reset.h"
#include "base/numerics/safe_conversions.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/input/web_keyboard_event.h"
#include "third_party/blink/public/common/input/web_menu_source_type.h"
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-blink.h"
#include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h"
#include "third_party/blink/public/mojom/scroll/scroll_into_view_params.mojom-blink.h"
#include "third_party/blink/renderer/core/accessibility/ax_object_cache.h"
#include "third_party/blink/renderer/core/accessibility/axid.h"
#include "third_party/blink/renderer/core/aom/accessible_node.h"
#include "third_party/blink/renderer/core/aom/accessible_node_list.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h"
#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/events/simulated_click_options.h"
#include "third_party/blink/renderer/core/dom/focus_params.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/dom/slot_assignment_engine.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/events/keyboard_event.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/fullscreen/fullscreen.h"
#include "third_party/blink/renderer/core/html/canvas/html_canvas_element.h"
#include "third_party/blink/renderer/core/html/custom/element_internals.h"
#include "third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.h"
#include "third_party/blink/renderer/core/html/forms/html_button_element.h"
#include "third_party/blink/renderer/core/html/forms/html_data_list_element.h"
#include "third_party/blink/renderer/core/html/forms/html_form_control_element.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/forms/html_label_element.h"
#include "third_party/blink/renderer/core/html/forms/html_opt_group_element.h"
#include "third_party/blink/renderer/core/html/forms/html_option_element.h"
#include "third_party/blink/renderer/core/html/forms/html_select_element.h"
#include "third_party/blink/renderer/core/html/forms/html_text_area_element.h"
#include "third_party/blink/renderer/core/html/forms/text_control_element.h"
#include "third_party/blink/renderer/core/html/html_body_element.h"
#include "third_party/blink/renderer/core/html/html_dialog_element.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html/html_embed_element.h"
#include "third_party/blink/renderer/core/html/html_frame_owner_element.h"
#include "third_party/blink/renderer/core/html/html_head_element.h"
#include "third_party/blink/renderer/core/html/html_hr_element.h"
#include "third_party/blink/renderer/core/html/html_html_element.h"
#include "third_party/blink/renderer/core/html/html_image_element.h"
#include "third_party/blink/renderer/core/html/html_map_element.h"
#include "third_party/blink/renderer/core/html/html_no_script_element.h"
#include "third_party/blink/renderer/core/html/html_progress_element.h"
#include "third_party/blink/renderer/core/html/html_script_element.h"
#include "third_party/blink/renderer/core/html/html_slot_element.h"
#include "third_party/blink/renderer/core/html/html_span_element.h"
#include "third_party/blink/renderer/core/html/html_style_element.h"
#include "third_party/blink/renderer/core/html/html_table_cell_element.h"
#include "third_party/blink/renderer/core/html/html_table_element.h"
#include "third_party/blink/renderer/core/html/html_table_row_element.h"
#include "third_party/blink/renderer/core/html/html_table_section_element.h"
#include "third_party/blink/renderer/core/html/html_title_element.h"
#include "third_party/blink/renderer/core/html/media/html_media_element.h"
#include "third_party/blink/renderer/core/html/parser/html_parser_idioms.h"
#include "third_party/blink/renderer/core/html/shadow/shadow_element_names.h"
#include "third_party/blink/renderer/core/input/context_menu_allowed_scope.h"
#include "third_party/blink/renderer/core/input/event_handler.h"
#include "third_party/blink/renderer/core/input_type_names.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/layout_box_model_object.h"
#include "third_party/blink/renderer/core/layout/layout_image.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/core/page/focus_controller.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/page/scrolling/top_document_root_scroller_controller.h"
#include "third_party/blink/renderer/core/scroll/scroll_into_view_util.h"
#include "third_party/blink/renderer/core/svg/svg_desc_element.h"
#include "third_party/blink/renderer/core/svg/svg_element.h"
#include "third_party/blink/renderer/core/svg/svg_g_element.h"
#include "third_party/blink/renderer/core/svg/svg_style_element.h"
#include "third_party/blink/renderer/core/svg/svg_title_element.h"
#include "third_party/blink/renderer/modules/accessibility/aria_notification.h"
#include "third_party/blink/renderer/modules/accessibility/ax_enums.h"
#if DCHECK_IS_ON()
#include "third_party/blink/renderer/modules/accessibility/ax_debug_utils.h"
#endif
#include "third_party/blink/renderer/modules/accessibility/ax_image_map_link.h"
#include "third_party/blink/renderer/modules/accessibility/ax_inline_text_box.h"
#include "third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h"
#include "third_party/blink/renderer/modules/accessibility/ax_range.h"
#include "third_party/blink/renderer/modules/accessibility/ax_selection.h"
#include "third_party/blink/renderer/modules/accessibility/ax_sparse_attribute_setter.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/keyboard_codes.h"
#include "third_party/blink/renderer/platform/language.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/text/platform_locale.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/blink/renderer/platform/wtf/wtf_size_t.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/accessibility/ax_action_data.h"
#include "ui/accessibility/ax_common.h"
#include "ui/accessibility/ax_enums.mojom-blink-forward.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_role_properties.h"
#include "ui/accessibility/ax_tree_id.h"
#include "ui/accessibility/ax_tree_source.h"
#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/gfx/geometry/transform.h"

namespace blink {

FormControlType;

namespace {

#if defined(AX_FAIL_FAST_BUILD)
// TODO(accessibility) Move this out of DEBUG by having a new enum in
// ax_enums.mojom, and a matching ToString() in ax_enum_utils, as well as move
// out duplicate code of String IgnoredReasonName(AXIgnoredReason reason) in
// inspector_type_builder_helper.cc.
String IgnoredReasonName(AXIgnoredReason reason) {}

String GetIgnoredReasonsDebugString(AXObject::IgnoredReasons& reasons) {}

#endif

String GetNodeString(Node* node) {}

#if DCHECK_IS_ON()
bool IsValidRole(ax::mojom::blink::Role role) {}
#endif

constexpr wtf_size_t kNumRoles =;

ARIARoleMap;

struct RoleEntry {};

// Mapping of ARIA role name to internal role name.
// This is used for the following:
// 1. Map from an ARIA role to the internal role when building tree.
// 2. Map from an internal role to an ARIA role name, for debugging, the
//    xml-roles object attribute and element.computedRole.
const RoleEntry kAriaRoles[] =;

// More friendly names for debugging, and for WPT tests.
// These are roles which map from the ARIA role name to the internal role when
// building the tree, but in DevTools or testing, we want to show the ARIA
// role name, since that is the publicly visible concept.
const RoleEntry kReverseRoles[] =;

static ARIARoleMap* CreateARIARoleMap() {}

// The role name vector contains only ARIA roles, and no internal roles.
static Vector<AtomicString>* CreateAriaRoleNameVector() {}

void AddIntListAttributeFromObjects(ax::mojom::blink::IntListAttribute attr,
                                    const AXObject::AXObjectVector& objects,
                                    ui::AXNodeData* node_data) {}

// Max length for attributes such as aria-label.
static constexpr uint32_t kMaxStringAttributeLength =;
// Max length for a static text name.
// Length of War and Peace (http://www.gutenberg.org/files/2600/2600-0.txt).
static constexpr uint32_t kMaxStaticTextLength =;

std::string TruncateString(const String& str,
                           uint32_t max_len = kMaxStringAttributeLength) {}

bool TruncateAndAddStringAttribute(
    ui::AXNodeData* dst,
    ax::mojom::blink::StringAttribute attribute,
    const String& value,
    uint32_t max_len = kMaxStringAttributeLength) {}

void AddIntListAttributeFromOffsetVector(
    ax::mojom::blink::IntListAttribute attr,
    const Vector<int> offsets,
    ui::AXNodeData* node_data) {}

}  // namespace

int32_t ToAXMarkerType(DocumentMarker::MarkerType marker_type) {}

int32_t ToAXHighlightType(const AtomicString& highlight_type) {}

const AXObject* FindAncestorWithAriaHidden(const AXObject* start) {}

// static
unsigned AXObject::number_of_live_ax_objects_ =;

AXObject::AXObject(AXObjectCacheImpl& ax_object_cache)
    :{}

AXObject::~AXObject() {}

void AXObject::SetHasDirtyDescendants(bool dirty) {}

void AXObject::SetAncestorsHaveDirtyDescendants() {}

void AXObject::Init(AXObject* parent) {}

void AXObject::Detach() {}

bool AXObject::IsDetached() const {}

bool AXObject::IsRoot() const {}

void AXObject::SetParent(AXObject* new_parent) {}

bool AXObject::IsMissingParent() const {}

// In many cases, ComputeParent() is not called, because the parent adding
// the parent adding the child will pass itself into AXObjectCacheImpl.
// ComputeParent() is still necessary because some parts of the code,
// especially web tests, result in AXObjects being created in the middle of
// the tree before their parents are created.
// TODO(accessibility) Consider forcing all ax objects to be created from
// the top down, eliminating the need for ComputeParent().
AXObject* AXObject::ComputeParent() const {}

// Same as ComputeParent, but without the extra check for valid parent in the
// end. This is for use in RestoreParentOrPrune.
AXObject* AXObject::ComputeParentOrNull() const {}

// static
Node* AXObject::GetParentNodeForComputeParent(AXObjectCacheImpl& cache,
                                              Node* node) {}

// static
bool AXObject::CanComputeAsNaturalParent(Node* node) {}

// static
bool AXObject::CanHaveChildren(Element& element) {}

// static
AXObject* AXObject::ComputeAccessibleNodeParent(
    AXObjectCacheImpl& cache,
    AccessibleNode& accessible_node) {}

// static
HTMLMapElement* AXObject::GetMapForImage(Node* image) {}

// static
AXObject* AXObject::ComputeNonARIAParent(AXObjectCacheImpl& cache,
                                         Node* current_node) {}

#if DCHECK_IS_ON()
std::string AXObject::GetAXTreeForThis() const {}

void AXObject::ShowAXTreeForThis() const {}

#endif

const AtomicString& AXObject::GetAOMPropertyOrARIAAttribute(
    AOMStringProperty property) const {}

Element* AXObject::GetAOMPropertyOrARIAAttribute(
    AOMRelationProperty property) const {}

bool AXObject::HasAOMProperty(AOMRelationListProperty property,
                              HeapVector<Member<Element>>& result) const {}

bool AXObject::HasAOMPropertyOrARIAAttribute(
    AOMRelationListProperty property,
    HeapVector<Member<Element>>& result) const {}

bool AXObject::HasAOMPropertyOrARIAAttribute(AOMBooleanProperty property,
                                             bool& result) const {}

bool AXObject::AOMPropertyOrARIAAttributeIsTrue(
    AOMBooleanProperty property) const {}

bool AXObject::AOMPropertyOrARIAAttributeIsFalse(
    AOMBooleanProperty property) const {}

bool AXObject::HasAOMPropertyOrARIAAttribute(AOMUIntProperty property,
                                             uint32_t& result) const {}

bool AXObject::HasAOMPropertyOrARIAAttribute(AOMIntProperty property,
                                             int32_t& result) const {}

bool AXObject::HasAOMPropertyOrARIAAttribute(AOMFloatProperty property,
                                             float& result) const {}

bool AXObject::HasAOMPropertyOrARIAAttribute(AOMStringProperty property,
                                             AtomicString& result) const {}

AccessibleNode* AXObject::GetAccessibleNode() const {}

namespace {

void SerializeAriaNotificationAttributes(const AriaNotifications& notifications,
                                         ui::AXNodeData* node_data) {}

}  // namespace

void AXObject::Serialize(ui::AXNodeData* node_data,
                         ui::AXMode accessibility_mode) const {}

void AXObject::SerializeBoundingBoxAttributes(ui::AXNodeData& dst) const {}

static bool AXShouldIncludePageScaleFactorInRoot() {}

void AXObject::PopulateAXRelativeBounds(ui::AXRelativeBounds& bounds,
                                        bool* clips_children) const {}

void AXObject::SerializeActionAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeChildTreeID(ui::AXNodeData* node_data) const {}

void AXObject::SerializeChooserPopupAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeColorAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeElementAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeHTMLTagAndClass(ui::AXNodeData* node_data) const {}

void AXObject::SerializeHTMLId(ui::AXNodeData* node_data) const {}

void AXObject::SerializeHTMLAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeInlineTextBox(ui::AXNodeData* node_data) const {}

void AXObject::SerializeLangAttribute(ui::AXNodeData* node_data) const {}

void AXObject::SerializeLineAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeListAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeListMarkerAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeLiveRegionAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeNameAndDescriptionAttributes(
    ui::AXMode accessibility_mode,
    ui::AXNodeData* node_data) const {}

void AXObject::SerializeScreenReaderAttributes(ui::AXNodeData* node_data) const {}

String AXObject::KeyboardShortcut() const {}

void AXObject::SerializeOtherScreenReaderAttributes(
    ui::AXNodeData* node_data) const {}

void AXObject::SerializeMathContent(ui::AXNodeData* node_data) const {}

void AXObject::SerializeScrollAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeSparseAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeStyleAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeTableAttributes(ui::AXNodeData* node_data) const {}

// Attributes that don't need to be serialized on ignored nodes.
void AXObject::SerializeUnignoredAttributes(ui::AXNodeData* node_data,
                                            ui::AXMode accessibility_mode) const {}

void AXObject::SerializeComputedDetailsRelation(
    ui::AXNodeData* node_data) const {}

bool AXObject::IsPlainContent() const {}

// Popover invoking elements should have details relationships with their
// target popover, when that popover is a) open, and b) not the next element
// in the DOM (depth first search order).
AXObject* AXObject::GetTargetPopoverForInvoker() const {}

// Try to get an aria-controls for an <input role="combobox">, because it
// helps identify focusable options in the listbox using activedescendant
// detection, even though the focus is on the textbox and not on the listbox
// ancestor.
AXObject* AXObject::GetControlsListboxForTextfieldCombobox() const {}

const AtomicString& AXObject::GetRoleStringForSerialization(
    ui::AXNodeData* node_data) const {}

void AXObject::SerializeMarkerAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeImageDataAttributes(ui::AXNodeData* node_data) const {}

void AXObject::SerializeTextInsertionDeletionOffsetAttributes(
    ui::AXNodeData* node_data) const {}

bool AXObject::IsAXNodeObject() const {}

bool AXObject::IsAXInlineTextBox() const {}

bool AXObject::IsList() const {}

bool AXObject::IsProgressIndicator() const {}

bool AXObject::IsAXRadioInput() const {}

bool AXObject::IsSlider() const {}

bool AXObject::IsValidationMessage() const {}

bool AXObject::IsVirtualObject() const {}

ax::mojom::blink::Role AXObject::ComputeFinalRoleForSerialization() const {}

ax::mojom::blink::Role AXObject::RoleValue() const {}

bool AXObject::IsARIATextField() const {}

bool AXObject::IsButton() const {}

bool AXObject::IsCanvas() const {}

bool AXObject::IsColorWell() const {}

bool AXObject::IsControl() const {}

bool AXObject::IsDefault() const {}

bool AXObject::IsFieldset() const {}

bool AXObject::IsHeading() const {}

bool AXObject::IsImage() const {}

bool AXObject::IsInputImage() const {}

bool AXObject::IsLink() const {}

bool AXObject::IsImageMapLink() const {}

bool AXObject::IsMenu() const {}

bool AXObject::IsCheckable() const {}

ax::mojom::blink::CheckedState AXObject::CheckedState() const {}

String AXObject::GetValueForControl() const {}

String AXObject::GetValueForControl(AXObjectSet& visited) const {}

String AXObject::SlowGetValueForControlIncludingContentEditable() const {}

String AXObject::SlowGetValueForControlIncludingContentEditable(
    AXObjectSet& visited) const {}

bool AXObject::IsNativeCheckboxInMixedState(const Node* node) {}

bool AXObject::IsMenuRelated() const {}

bool AXObject::IsMeter() const {}

bool AXObject::IsNativeImage() const {}

bool AXObject::IsNativeSpinButton() const {}

bool AXObject::IsAtomicTextField() const {}

bool AXObject::IsNonAtomicTextField() const {}

AXObject* AXObject::GetTextFieldAncestor() {}

bool AXObject::IsPasswordField() const {}

bool AXObject::IsPasswordFieldAndShouldHideValue() const {}

bool AXObject::IsPresentational() const {}

bool AXObject::IsTextObject() const {}

bool AXObject::IsRangeValueSupported() const {}

bool AXObject::IsScrollbar() const {}

bool AXObject::IsNativeSlider() const {}

bool AXObject::IsSpinButton() const {}

bool AXObject::IsTabItem() const {}

bool AXObject::IsTextField() const {}

bool AXObject::IsAutofillAvailable() const {}

bool AXObject::IsClickable() const {}

AccessibilityExpanded AXObject::IsExpanded() const {}

bool AXObject::IsFocused() const {}

bool AXObject::IsHovered() const {}

bool AXObject::IsLineBreakingObject() const {}

bool AXObject::IsLinked() const {}

bool AXObject::IsLoaded() const {}

bool AXObject::IsMultiSelectable() const {}

bool AXObject::IsOffScreen() const {}

bool AXObject::IsRequired() const {}

AccessibilitySelectedState AXObject::IsSelected() const {}

bool AXObject::IsSelectedFromFocusSupported() const {}

bool AXObject::IsSelectedFromFocus() const {}

bool AXObject::IsNotUserSelectable() const {}

bool AXObject::IsVisited() const {}

bool AXObject::IsIgnored() const {}

bool AXObject::IsIgnored() {}

bool AXObject::IsIgnoredButIncludedInTree() const {}

bool AXObject::IsIgnoredButIncludedInTree() {}

// IsIncludedInTree should be true for all nodes that should be
// included in the tree, even if they are ignored
bool AXObject::CachedIsIncludedInTree() const {}

bool AXObject::IsIncludedInTree() const {}

bool AXObject::IsIncludedInTree() {}

void AXObject::CheckCanAccessCachedValues() const {}

void AXObject::InvalidateCachedValues() {}

void AXObject::UpdateCachedAttributeValuesIfNeeded(
    bool notify_parent_of_ignored_changes) {}

void AXObject::OnInheritedCachedValuesChanged() {}

bool AXObject::ComputeIsIgnored(
    IgnoredReasons* ignored_reasons) const {}

bool AXObject::ShouldIgnoreForHiddenOrInert(
    IgnoredReasons* ignored_reasons) const {}

// Note: do not rely on the value of this inside of display:none.
// In practice, it does not matter because nodes in display:none subtrees are
// marked ignored either way.
bool AXObject::IsInert() {}

bool AXObject::ComputeIsInertViaStyle(const ComputedStyle* style,
                                      IgnoredReasons* ignored_reasons) const {}

bool AXObject::ComputeIsInert(IgnoredReasons* ignored_reasons) const {}

bool AXObject::IsAriaHiddenRoot() const {}

bool AXObject::IsAriaHidden() {}

bool AXObject::ComputeIsAriaHidden(IgnoredReasons* ignored_reasons) const {}

bool AXObject::IsModal() const {}

bool AXObject::IsBlockedByAriaModalDialog(
    IgnoredReasons* ignored_reasons) const {}

bool AXObject::IsVisible() const {}

const AXObject* AXObject::AriaHiddenRoot() const {}

const AXObject* AXObject::InertRoot() const {}

bool AXObject::DispatchEventToAOMEventListeners(Event& event) {}

bool AXObject::IsDescendantOfDisabledNode() {}

bool AXObject::ComputeIsDescendantOfDisabledNode() {}

bool AXObject::IsExcludedByFormControlsFilter() const {}

bool AXObject::ComputeIsIgnoredButIncludedInTree() {}

const AXObject* AXObject::GetAtomicTextFieldAncestor(
    int max_levels_to_check) const {}

const AXObject* AXObject::DatetimeAncestor() const {}

ax::mojom::blink::Role AXObject::DetermineRoleValue() {}

bool AXObject::CanSetValueAttribute() const {}

bool AXObject::CanSetFocusAttribute() {}

// TODO(accessibility) Look at reusing Element::IsFocusable() or
// AXObject::IsKeyboardFocusable(). As long as we guard against style recalc by
// returning early if IsHiddenViaStyle() is true, we can call
// Element::IsKeyboardFocusable(), which would otherwise recalculate style at an
// awkward time.
bool AXObject::ComputeCanSetFocusAttribute() {}

bool AXObject::IsKeyboardFocusable() const {}

bool AXObject::CanSetSelectedAttribute() const {}

bool AXObject::IsSubWidget() const {}

bool AXObject::SupportsARIASetSizeAndPosInSet() const {}

bool AXObject::IsProhibited(ax::mojom::blink::StringAttribute attribute) const {}

bool AXObject::IsProhibited(
    ax::mojom::blink::IntListAttribute attribute) const {}

std::string AXObject::GetProhibitedNameError(
    const String& prohibited_name,
    ax::mojom::blink::NameFrom& prohibited_name_from) const {}

// Simplify whitespace, but preserve a single leading and trailing whitespace
// character if it's present.
String AXObject::SimplifyName(const String& str,
                              ax::mojom::blink::NameFrom& name_from) const {}

String AXObject::ComputedName(ax::mojom::blink::NameFrom* name_from_out) const {}

bool AXObject::IsNameProhibited() const {}

String AXObject::GetName(ax::mojom::blink::NameFrom& name_from,
                         AXObject::AXObjectVector* name_objects) const {}

String AXObject::GetName(NameSources* name_sources) const {}

String AXObject::RecursiveTextAlternative(
    const AXObject& ax_obj,
    const AXObject* aria_label_or_description_root,
    AXObjectSet& visited) {}

String AXObject::RecursiveTextAlternative(
    const AXObject& ax_obj,
    const AXObject* aria_label_or_description_root,
    AXObjectSet& visited,
    ax::mojom::blink::NameFrom& name_from) {}

const ComputedStyle* AXObject::GetComputedStyle() const {}

// There are 4 ways to use CSS to hide something:
// * "display: none" is "destroy rendering state and don't do anything in the
//   subtree"
// * "visibility: [hidden|collapse]" are "don't visually show things, but still
//   keep all of the rendering up to date"
// * "content-visibility: hidden" is "don't show anything, skip all of the
//   work, but don't destroy the work that was already there"
// * "content-visibility: auto" is "paint when it's scrolled into the viewport,
//   but its layout information is not updated when it isn't"
bool AXObject::ComputeIsHiddenViaStyle(const ComputedStyle* style) {}

bool AXObject::IsHiddenViaStyle() {}

// Return true if this should be removed from accessible name computations.
// We must take into account if we are traversing an aria-labelledby or
// describedby relation, because those can use hidden subtrees. When the target
// node of the aria-labelledby or describedby relation is hidden, we contribute
// all its children, because there is no way to know if they are explicitly
// hidden or they inherited the hidden value. See:
// https://github.com/w3c/accname/issues/57
bool AXObject::IsHiddenForTextAlternativeCalculation(
    const AXObject* aria_label_or_description_root) const {}

bool AXObject::IsUsedForLabelOrDescription() {}

bool AXObject::ComputeIsUsedForLabelOrDescription() {}

String AXObject::AriaTextAlternative(
    bool recursive,
    const AXObject* aria_label_or_description_root,
    AXObjectSet& visited,
    ax::mojom::blink::NameFrom& name_from,
    AXRelatedObjectVector* related_objects,
    NameSources* name_sources,
    bool* found_text_alternative) const {}

#if EXPENSIVE_DCHECKS_ARE_ON()
void AXObject::CheckSubtreeIsForLabelOrDescription(const AXObject* obj) const {}
#endif

String AXObject::TextFromElements(
    bool in_aria_labelledby_traversal,
    AXObjectSet& visited,
    HeapVector<Member<Element>>& elements,
    AXRelatedObjectVector* related_objects) const {}

// static
void AXObject::TokenVectorFromAttribute(Element* element,
                                        Vector<String>& tokens,
                                        const QualifiedName& attribute) {}

// static
bool AXObject::ElementsFromAttribute(Element* from,
                                     HeapVector<Member<Element>>& elements,
                                     const QualifiedName& attribute) {}

// static
bool AXObject::AriaLabelledbyElementVector(
    Element* from,
    HeapVector<Member<Element>>& elements) {}

// static
bool AXObject::IsNameFromAriaAttribute(Element* element) {}

bool AXObject::IsNameFromAuthorAttribute() const {}

AXObject* AXObject::InPageLinkTarget() const {}

const AtomicString& AXObject::EffectiveTarget() const {}

AccessibilityOrientation AXObject::Orientation() const {}

AXObject* AXObject::GetChildFigcaption() const {}

bool AXObject::IsDescendantOfLandmarkDisallowedElement() const {}

void AXObject::LoadInlineTextBoxes() {}

void AXObject::LoadInlineTextBoxesHelper() {}

AXObject* AXObject::NextOnLine() const {}

AXObject* AXObject::PreviousOnLine() const {}

std::optional<const DocumentMarker::MarkerType>
AXObject::GetAriaSpellingOrGrammarMarker() const {}

void AXObject::TextCharacterOffsets(Vector<int>&) const {}

void AXObject::GetWordBoundaries(Vector<int>& word_starts,
                                 Vector<int>& word_ends) const {}

int AXObject::TextLength() const {}

int AXObject::TextOffsetInFormattingContext(int offset) const {}

int AXObject::TextOffsetInContainer(int offset) const {}

ax::mojom::blink::DefaultActionVerb AXObject::Action() const {}

bool AXObject::AriaPressedIsPresent() const {}

bool AXObject::AriaCheckedIsPresent() const {}

bool AXObject::SupportsARIAExpanded() const {}

bool DoesUndoRolePresentation(const AtomicString& name) {}

bool AXObject::HasAriaAttribute(bool does_undo_role_presentation) const {}

int AXObject::IndexInParent() const {}

bool AXObject::IsOnlyChild() const {}

bool AXObject::IsInMenuListSubtree() {}

bool AXObject::ComputeIsInMenuListSubtree() {}

bool AXObject::IsMenuList() const {}

const AXObject* AXObject::AncestorMenuListOption() const {}

const AXObject* AXObject::AncestorMenuList() const {}

bool AXObject::IsLiveRegionRoot() const {}

bool AXObject::IsActiveLiveRegionRoot() const {}

const AtomicString& AXObject::LiveRegionStatus() const {}

const AtomicString& AXObject::LiveRegionRelevant() const {}

bool AXObject::IsDisabled() const {}

AXRestriction AXObject::Restriction() const {}

ax::mojom::blink::Role AXObject::RawAriaRole() const {}

ax::mojom::blink::Role AXObject::DetermineRawAriaRole() const {}

ax::mojom::blink::Role AXObject::DetermineAriaRole() const {}

ax::mojom::blink::HasPopup AXObject::HasPopup() const {}

ax::mojom::blink::IsPopup AXObject::IsPopup() const {}

bool AXObject::IsEditable() const {}

bool AXObject::IsEditableRoot() const {}

bool AXObject::HasContentEditableAttributeSet() const {}

bool AXObject::IsMultiline() const {}

bool AXObject::IsRichlyEditable() const {}

AXObject* AXObject::LiveRegionRoot() {}

bool AXObject::LiveRegionAtomic() const {}

const AtomicString& AXObject::ContainerLiveRegionStatus() const {}

const AtomicString& AXObject::ContainerLiveRegionRelevant() const {}

bool AXObject::ContainerLiveRegionAtomic() const {}

bool AXObject::ContainerLiveRegionBusy() const {}

AXObject* AXObject::ElementAccessibilityHitTest(const gfx::Point& point) const {}

AXObject::AncestorsIterator AXObject::UnignoredAncestorsBegin() const {}

AXObject::AncestorsIterator AXObject::UnignoredAncestorsEnd() const {}

int AXObject::ChildCountIncludingIgnored() const {}

AXObject* AXObject::ChildAtIncludingIgnored(int index) const {}

const AXObject::AXObjectVector& AXObject::ChildrenIncludingIgnored() const {}

const AXObject::AXObjectVector& AXObject::ChildrenIncludingIgnored() {}

const AXObject::AXObjectVector AXObject::UnignoredChildren() const {}

const AXObject::AXObjectVector AXObject::UnignoredChildren() {}

AXObject* AXObject::FirstChildIncludingIgnored() const {}

AXObject* AXObject::LastChildIncludingIgnored() const {}

AXObject* AXObject::DeepestFirstChildIncludingIgnored() const {}

AXObject* AXObject::DeepestLastChildIncludingIgnored() const {}

AXObject* AXObject::NextSiblingIncludingIgnored() const {}

AXObject* AXObject::PreviousSiblingIncludingIgnored() const {}

AXObject* AXObject::CachedPreviousSiblingIncludingIgnored() const {}

AXObject* AXObject::NextInPreOrderIncludingIgnored(
    const AXObject* within) const {}

AXObject* AXObject::PreviousInPreOrderIncludingIgnored(
    const AXObject* within) const {}

AXObject* AXObject::PreviousInPostOrderIncludingIgnored(
    const AXObject* within) const {}

AXObject* AXObject::FirstObjectWithRole(ax::mojom::blink::Role role) const {}

int AXObject::UnignoredChildCount() const {}

AXObject* AXObject::UnignoredChildAt(int index) const {}

AXObject* AXObject::UnignoredNextSibling() const {}

AXObject* AXObject::UnignoredPreviousSibling() const {}

AXObject* AXObject::UnignoredNextInPreOrder() const {}

AXObject* AXObject::UnignoredPreviousInPreOrder() const {}

AXObject* AXObject::ParentObject() const {}

AXObject* AXObject::ParentObject() {}

AXObject* AXObject::ParentObjectUnignored() const {}

AXObject* AXObject::ParentObjectIncludedInTree() const {}

Element* AXObject::GetClosestElement() const {}

// Container widgets are those that a user tabs into and arrows around
// sub-widgets
bool AXObject::IsContainerWidget() const {}

AXObject* AXObject::ContainerWidget() const {}

AXObject* AXObject::ContainerListMarkerIncludingIgnored() const {}

// Determine which traversal approach is used to get children of an object.
bool AXObject::ShouldUseLayoutObjectTraversalForChildren() const {}

void AXObject::UpdateChildrenIfNecessary() {}

bool AXObject::NeedsToUpdateChildren() const {}

#if DCHECK_IS_ON()
void AXObject::CheckIncludedObjectConnectedToRoot() const {}
#endif

void AXObject::SetNeedsToUpdateChildren(bool update) {}

// static
bool AXObject::CanSafelyUseFlatTreeTraversalNow(Document& document) {}

bool AXObject::ShouldDestroyWhenDetachingFromParent() const {}

void AXObject::DetachFromParent() {}

void AXObject::SetChildTree(const ui::AXTreeID& child_tree_id) {}

void AXObject::ClearChildren() {}

void AXObject::ChildrenChangedWithCleanLayout() {}

Node* AXObject::GetNode() const {}

LayoutObject* AXObject::GetLayoutObject() const {}

Element* AXObject::GetElement() const {}

AXObject* AXObject::RootScroller() const {}

LocalFrameView* AXObject::DocumentFrameView() const {}

AtomicString AXObject::Language() const {}

//
// Scrollable containers.
//

bool AXObject::IsScrollableContainer() const {}

bool AXObject::IsUserScrollable() const {}

gfx::Point AXObject::GetScrollOffset() const {}

gfx::Point AXObject::MinimumScrollOffset() const {}

gfx::Point AXObject::MaximumScrollOffset() const {}

void AXObject::SetScrollOffset(const gfx::Point& offset) const {}

void AXObject::Scroll(ax::mojom::blink::Action scroll_action) const {}

bool AXObject::IsTableLikeRole() const {}

bool AXObject::IsTableRowLikeRole() const {}

bool AXObject::IsTableCellLikeRole() const {}

unsigned AXObject::ColumnCount() const {}

unsigned AXObject::RowCount() const {}

void AXObject::ColumnHeaders(AXObjectVector& headers) const {}

void AXObject::RowHeaders(AXObjectVector& headers) const {}

AXObject* AXObject::CellForColumnAndRow(unsigned target_column_index,
                                        unsigned target_row_index) const {}

int AXObject::AriaColumnCount() const {}

int AXObject::AriaRowCount() const {}

unsigned AXObject::ColumnIndex() const {}

unsigned AXObject::RowIndex() const {}

unsigned AXObject::ColumnSpan() const {}

unsigned AXObject::RowSpan() const {}

unsigned AXObject::AriaColumnIndex() const {}

unsigned AXObject::AriaRowIndex() const {}

AXObject::AXObjectVector AXObject::TableRowChildren() const {}

AXObject::AXObjectVector AXObject::TableCellChildren() const {}

void AXObject::GetRelativeBounds(AXObject** out_container,
                                 gfx::RectF& out_bounds_in_container,
                                 gfx::Transform& out_container_transform,
                                 bool* clips_children) const {}

gfx::RectF AXObject::LocalBoundingBoxRectForAccessibility() {}

PhysicalRect AXObject::GetBoundsInFrameCoordinates() const {}

void AXObject::UpdateStyleAndLayoutTreeForNode(Node& node) {}

//
// Modify or take an action on an object.
//

bool AXObject::PerformAction(const ui::AXActionData& action_data) {}

bool AXObject::RequestDecrementAction() {}

bool AXObject::RequestClickAction() {}

bool AXObject::OnNativeClickAction() {}

bool AXObject::RequestFocusAction() {}

bool AXObject::RequestIncrementAction() {}

bool AXObject::RequestScrollToGlobalPointAction(const gfx::Point& point) {}

bool AXObject::RequestScrollToMakeVisibleAction() {}

bool AXObject::RequestScrollToMakeVisibleWithSubFocusAction(
    const gfx::Rect& subfocus,
    blink::mojom::blink::ScrollAlignment horizontal_scroll_alignment,
    blink::mojom::blink::ScrollAlignment vertical_scroll_alignment) {}

bool AXObject::RequestSetSelectedAction(bool selected) {}

bool AXObject::RequestSetSequentialFocusNavigationStartingPointAction() {}

bool AXObject::RequestSetValueAction(const String& value) {}

bool AXObject::RequestShowContextMenuAction() {}

bool AXObject::RequestExpandAction() {}

bool AXObject::RequestCollapseAction() {}

bool AXObject::OnNativeKeyboardAction(const ax::mojom::Action action) {}

bool AXObject::InternalSetAccessibilityFocusAction() {}

bool AXObject::InternalClearAccessibilityFocusAction() {}

LayoutObject* AXObject::GetLayoutObjectForNativeScrollAction() const {}

void AXObject::DispatchKeyboardEvent(LocalDOMWindow* local_dom_window,
                                     WebInputEvent::Type type,
                                     ax::mojom::blink::Action action) const {}

bool AXObject::OnNativeScrollToMakeVisibleAction() const {}

bool AXObject::OnNativeScrollToMakeVisibleWithSubFocusAction(
    const gfx::Rect& rect,
    blink::mojom::blink::ScrollAlignment horizontal_scroll_alignment,
    blink::mojom::blink::ScrollAlignment vertical_scroll_alignment) const {}

bool AXObject::OnNativeScrollToGlobalPointAction(
    const gfx::Point& global_point) const {}

bool AXObject::OnNativeSetSequentialFocusNavigationStartingPointAction() {}

bool AXObject::OnNativeDecrementAction() {}

bool AXObject::OnNativeBlurAction() {}

bool AXObject::OnNativeFocusAction() {}

bool AXObject::OnNativeIncrementAction() {}

bool AXObject::OnNativeSetValueAction(const String&) {}

bool AXObject::OnNativeSetSelectedAction(bool) {}

bool AXObject::OnNativeShowContextMenuAction() {}

// static
bool AXObject::IsFrame(const Node* node) {}

// static
bool AXObject::HasARIAOwns(Element* element) {}

// static
ax::mojom::blink::Role AXObject::FirstValidRoleInRoleString(
    const String& value,
    bool ignore_form_and_region) {}

bool AXObject::SupportsNameFromContents(bool recursive) const {}

bool AXObject::SupportsARIAReadOnly() const {}

ax::mojom::blink::Role AXObject::ButtonRoleType() const {}

// static
const AtomicString& AXObject::AriaRoleName(ax::mojom::blink::Role role) {}

const String AXObject::InternalRoleName(ax::mojom::blink::Role role) {}

// static
const String AXObject::RoleName(ax::mojom::blink::Role role,
                                bool* is_internal) {}

// static
const AXObject* AXObject::LowestCommonAncestor(const AXObject& first,
                                               const AXObject& second,
                                               int* index_in_ancestor1,
                                               int* index_in_ancestor2) {}

// Extra checks that only occur during serialization.
void AXObject::PreSerializationConsistencyCheck() const{}

String AXObject::ToString(bool verbose) const {}

bool operator==(const AXObject& first, const AXObject& second) {}

bool operator!=(const AXObject& first, const AXObject& second) {}

bool operator<(const AXObject& first, const AXObject& second) {}

bool operator<=(const AXObject& first, const AXObject& second) {}

bool operator>(const AXObject& first, const AXObject& second) {}

bool operator>=(const AXObject& first, const AXObject& second) {}

std::ostream& operator<<(std::ostream& stream, const AXObject* obj) {}

std::ostream& operator<<(std::ostream& stream, const AXObject& obj) {}

void AXObject::Trace(Visitor* visitor) const {}

}  // namespace blink