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

/*
 * Copyright (C) 2012, Google 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_node_object.h"

#include <math.h>

#include <algorithm>
#include <memory>
#include <optional>
#include <queue>

#include "base/auto_reset.h"
#include "base/containers/contains.h"
#include "base/containers/fixed_flat_set.h"
#include "base/numerics/safe_conversions.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/mojom/frame/user_activation_notification_type.mojom-blink.h"
#include "third_party/blink/public/strings/grit/blink_strings.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_image_bitmap_options.h"
#include "third_party/blink/renderer/core/aom/accessible_node.h"
#include "third_party/blink/renderer/core/css/counter_style_map.h"
#include "third_party/blink/renderer/core/css/css_resolution_units.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h"
#include "third_party/blink/renderer/core/dom/flat_tree_traversal.h"
#include "third_party/blink/renderer/core/dom/focus_params.h"
#include "third_party/blink/renderer/core/dom/layout_tree_builder_traversal.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/node_traversal.h"
#include "third_party/blink/renderer/core/dom/qualified_name.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/markers/custom_highlight_marker.h"
#include "third_party/blink/renderer/core/editing/markers/document_marker_controller.h"
#include "third_party/blink/renderer/core/editing/position.h"
#include "third_party/blink/renderer/core/events/event_util.h"
#include "third_party/blink/renderer/core/events/keyboard_event.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.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/highlight/highlight.h"
#include "third_party/blink/renderer/core/html/canvas/html_canvas_element.h"
#include "third_party/blink/renderer/core/html/canvas/image_data.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_field_set_element.h"
#include "third_party/blink/renderer/core/html/forms/html_form_control_element.h"
#include "third_party/blink/renderer/core/html/forms/html_form_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_legend_element.h"
#include "third_party/blink/renderer/core/html/forms/html_listbox_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_output_element.h"
#include "third_party/blink/renderer/core/html/forms/html_select_element.h"
#include "third_party/blink/renderer/core/html/forms/html_select_list_element.h"
#include "third_party/blink/renderer/core/html/forms/html_text_area_element.h"
#include "third_party/blink/renderer/core/html/forms/labels_node_list.h"
#include "third_party/blink/renderer/core/html/forms/radio_input_type.h"
#include "third_party/blink/renderer/core/html/forms/text_control_element.h"
#include "third_party/blink/renderer/core/html/html_anchor_element.h"
#include "third_party/blink/renderer/core/html/html_body_element.h"
#include "third_party/blink/renderer/core/html/html_details_element.h"
#include "third_party/blink/renderer/core/html/html_dialog_element.h"
#include "third_party/blink/renderer/core/html/html_div_element.h"
#include "third_party/blink/renderer/core/html/html_dlist_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_element_base.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_li_element.h"
#include "third_party/blink/renderer/core/html/html_map_element.h"
#include "third_party/blink/renderer/core/html/html_menu_element.h"
#include "third_party/blink/renderer/core/html/html_meter_element.h"
#include "third_party/blink/renderer/core/html/html_olist_element.h"
#include "third_party/blink/renderer/core/html/html_paragraph_element.h"
#include "third_party/blink/renderer/core/html/html_permission_element.h"
#include "third_party/blink/renderer/core/html/html_plugin_element.h"
#include "third_party/blink/renderer/core/html/html_progress_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_summary_element.h"
#include "third_party/blink/renderer/core/html/html_table_caption_element.h"
#include "third_party/blink/renderer/core/html/html_table_cell_element.h"
#include "third_party/blink/renderer/core/html/html_table_col_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_time_element.h"
#include "third_party/blink/renderer/core/html/html_ulist_element.h"
#include "third_party/blink/renderer/core/html/media/html_audio_element.h"
#include "third_party/blink/renderer/core/html/media/html_media_element.h"
#include "third_party/blink/renderer/core/html/media/html_video_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/html_names.h"
#include "third_party/blink/renderer/core/imagebitmap/image_bitmap.h"
#include "third_party/blink/renderer/core/input_type_names.h"
#include "third_party/blink/renderer/core/layout/hit_test_location.h"
#include "third_party/blink/renderer/core/layout/hit_test_result.h"
#include "third_party/blink/renderer/core/layout/inline/abstract_inline_text_box.h"
#include "third_party/blink/renderer/core/layout/inline/inline_cursor.h"
#include "third_party/blink/renderer/core/layout/inline/inline_node.h"
#include "third_party/blink/renderer/core/layout/inline/offset_mapping.h"
#include "third_party/blink/renderer/core/layout/layout_block_flow.h"
#include "third_party/blink/renderer/core/layout/layout_box_model_object.h"
#include "third_party/blink/renderer/core/layout/layout_html_canvas.h"
#include "third_party/blink/renderer/core/layout/layout_inline.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/layout/table/layout_table.h"
#include "third_party/blink/renderer/core/layout/table/layout_table_cell.h"
#include "third_party/blink/renderer/core/layout/table/layout_table_row.h"
#include "third_party/blink/renderer/core/layout/table/layout_table_section.h"
#include "third_party/blink/renderer/core/loader/progress_tracker.h"
#include "third_party/blink/renderer/core/mathml/mathml_element.h"
#include "third_party/blink/renderer/core/mathml_names.h"
#include "third_party/blink/renderer/core/navigation_api/navigation_api.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/style/computed_style_constants.h"
#include "third_party/blink/renderer/core/svg/svg_a_element.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_foreign_object_element.h"
#include "third_party/blink/renderer/core/svg/svg_g_element.h"
#include "third_party/blink/renderer/core/svg/svg_svg_element.h"
#include "third_party/blink/renderer/core/svg/svg_symbol_element.h"
#include "third_party/blink/renderer/core/svg/svg_text_element.h"
#include "third_party/blink/renderer/core/svg/svg_title_element.h"
#include "third_party/blink/renderer/core/svg/svg_use_element.h"
#include "third_party/blink/renderer/core/xlink_names.h"
#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_node_object.h"
#include "third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h"
#include "third_party/blink/renderer/modules/accessibility/ax_position.h"
#include "third_party/blink/renderer/modules/accessibility/ax_range.h"
#include "third_party/blink/renderer/modules/accessibility/ax_relation_cache.h"
#include "third_party/blink/renderer/platform/graphics/image_data_buffer.h"
#include "third_party/blink/renderer/platform/keyboard_codes.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/text/text_direction.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/skia/include/core/SkImage.h"
#include "ui/accessibility/ax_common.h"
#include "ui/accessibility/ax_role_properties.h"
#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/gfx/geometry/transform.h"

namespace {

bool ShouldUseLayoutNG(const blink::LayoutObject& layout_object) {}

// It is not easily possible to find out if an element is the target of an
// in-page link.
// As a workaround, we consider the following to be potential targets:
// - <a name>
// - <foo id> -- an element with an id that is not SVG, a <label> or <optgroup>.
//     <label> does not make much sense as an in-page link target.
//     Exposing <optgroup> is redundant, as the group is already exposed via a
//     child in its shadow DOM, which contains the accessible name.
//   #document -- this is always a potential link target via <a name="#">.
//   This is a compromise that does not include too many elements, and
//   has minimal impact on tests.
bool IsPotentialInPageLinkTarget(blink::Node& node) {}

bool IsLinkable(const blink::AXObject& object) {}

bool IsImageOrAltText(blink::LayoutObject* layout_object, blink::Node* node) {}

bool ShouldIgnoreListItem(blink::Node* node) {}

bool IsNeutralWithinTable(blink::AXObject* obj) {}

// Within a table, provide the accessible, semantic parent of |node|,
// by traversing the DOM tree, ignoring elements that are neutral in a table.
// Return the AXObject for the ancestor.
blink::AXObject* GetDOMTableAXAncestor(blink::Node* node,
                                       blink::AXObjectCacheImpl& cache) {}

// Return the first LayoutTableSection if maybe_table is a non-anonymous
// table. If non-null, set table_out to the containing table.
blink::LayoutTableSection* FirstTableSection(
    blink::LayoutObject* maybe_table,
    blink::LayoutTable** table_out = nullptr) {}

enum class AXAction {};

blink::KeyboardEvent* CreateKeyboardEvent(
    blink::LocalDOMWindow* local_dom_window,
    blink::WebInputEvent::Type type,
    AXAction action,
    blink::AccessibilityOrientation orientation,
    ax::mojom::blink::WritingDirection text_direction) {}

unsigned TextStyleFlag(ax::mojom::blink::TextStyle text_style_enum) {}

ax::mojom::blink::TextDecorationStyle
TextDecorationStyleToAXTextDecorationStyle(
    const blink::ETextDecorationStyle text_decoration_style) {}

String GetTitle(blink::Element* element) {}

bool CanHaveInlineTextBoxChildren(const blink::AXObject* obj) {}

bool HasLayoutText(const blink::AXObject* obj) {}

}  // namespace

namespace blink {

kAltAttr;
kTitleAttr;
kTypeAttr;
kValueAttr;
FormControlType;

// In ARIA 1.1, default value of aria-level was changed to 2.
const int kDefaultHeadingLevel =;

// When an AXNodeObject is created with a Node instead of a LayoutObject it
// means that the LayoutObject is purposely being set to null, as it is not
// relevant for this object in the AX tree.
AXNodeObject::AXNodeObject(Node* node, AXObjectCacheImpl& ax_object_cache)
    :{}

AXNodeObject::AXNodeObject(LayoutObject* layout_object,
                           AXObjectCacheImpl& ax_object_cache)
    :{}

AXNodeObject::~AXNodeObject() {}

void AXNodeObject::AlterSliderOrSpinButtonValue(bool increase) {}

AXObject* AXNodeObject::ActiveDescendant() const {}

bool IsExemptFromInlineBlockCheck(ax::mojom::blink::Role role) {}

AXObjectInclusion AXNodeObject::ShouldIncludeBasedOnSemantics(
    IgnoredReasons* ignored_reasons) const {}

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

// static
std::optional<String> AXNodeObject::GetCSSAltText(const Element* element) {}

// The following lists are for deciding whether the tags aside,
// header and footer can be interpreted as roles complementary, banner and
// contentInfo or if they should be interpreted as generic, sectionheader, or
// sectionfooter.
// This function only handles the complementary, banner, and contentInfo roles,
// which belong to the landmark roles set.
static HashSet<ax::mojom::blink::Role>& GetLandmarkIsNotAllowedAncestorRoles(
    ax::mojom::blink::Role landmark) {}

bool AXNodeObject::IsDescendantOfLandmarkDisallowedElement() const {}

static bool IsNonEmptyNonHeaderCell(const Node* cell) {}

static bool IsHeaderCell(const Node* cell) {}

static ax::mojom::blink::Role DecideRoleFromSiblings(Element* cell) {}

ax::mojom::blink::Role AXNodeObject::DetermineTableSectionRole() const {}

ax::mojom::blink::Role AXNodeObject::DetermineTableRowRole() const {}

ax::mojom::blink::Role AXNodeObject::DetermineTableCellRole() const {}

unsigned AXNodeObject::ColumnCount() const {}

unsigned AXNodeObject::RowCount() const {}

unsigned AXNodeObject::ColumnIndex() const {}

unsigned AXNodeObject::RowIndex() const {}

unsigned AXNodeObject::ColumnSpan() const {}

unsigned AXNodeObject::RowSpan() const {}

ax::mojom::blink::SortDirection AXNodeObject::GetSortDirection() const {}

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

bool AXNodeObject::FindAllTableCellsWithRole(ax::mojom::blink::Role role,
                                             AXObjectVector& cells) const {}

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

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

AXObject* AXNodeObject::HeaderObject() const {}

// The following is a heuristic used to determine if a
// <table> should be with ax::mojom::blink::Role::kTable or
// ax::mojom::blink::Role::kLayoutTable.
// Only "data" tables should be exposed as tables.
// Unfortunately, there is no determinsistic or precise way to differentiate a
// layout table vs a data table. Fortunately, CSS authoring techniques have
// improved a lot and mostly supplanted the practice of using tables for layout.
bool AXNodeObject::IsDataTable() const {}

// TODO(accessibility) Consider combining with NativeRoleIgnoringAria().
ax::mojom::blink::Role AXNodeObject::RoleFromLayoutObjectOrNode() const {}

// Does not check ARIA role, but does check some ARIA properties, specifically
// @aria-haspopup/aria-pressed via ButtonType().
ax::mojom::blink::Role AXNodeObject::NativeRoleIgnoringAria() const {}

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

void AXNodeObject::AccessibilityChildrenFromAOMProperty(
    AOMRelationListProperty property,
    AXObject::AXObjectVector& children) const {}

static Element* SiblingWithAriaRole(String role, Node* node) {}

Element* AXNodeObject::MenuItemElementForMenu() const {}

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

void AXNodeObject::Detach() {}

bool AXNodeObject::IsAXNodeObject() const {}

bool AXNodeObject::IsControl() const {}

bool AXNodeObject::IsAutofillAvailable() const {}

bool AXNodeObject::IsDefault() const {}

bool AXNodeObject::IsFieldset() const {}

bool AXNodeObject::IsHovered() const {}

bool AXNodeObject::IsImageButton() const {}

bool AXNodeObject::IsInputImage() const {}

bool AXNodeObject::IsLineBreakingObject() const {}

bool AXNodeObject::IsLoaded() const {}

bool AXNodeObject::IsMultiSelectable() const {}

bool AXNodeObject::IsNativeImage() const {}

bool AXNodeObject::IsVisible() const {}

bool AXNodeObject::IsOffScreen() const {}

bool AXNodeObject::IsLinked() const {}

bool AXNodeObject::IsVisited() const {}

bool AXNodeObject::IsProgressIndicator() const {}

bool AXNodeObject::IsSlider() const {}

bool AXNodeObject::IsSpinButton() const {}

bool AXNodeObject::IsNativeSlider() const {}

bool AXNodeObject::IsNativeSpinButton() const {}

bool AXNodeObject::IsEmbeddingElement() const {}

bool AXNodeObject::IsClickable() const {}

bool AXNodeObject::IsFocused() const {}

AccessibilitySelectedState AXNodeObject::IsSelected() const {}

bool AXNodeObject::IsSelectedFromFocusSupported() const {}

// In single selection containers, selection follows focus unless aria_selected
// is set to false. This is only valid for a subset of elements.
bool AXNodeObject::IsSelectedFromFocus() const {}

// Returns true if the object is marked user-select:none
bool AXNodeObject::IsNotUserSelectable() const {}

bool AXNodeObject::IsTabItemSelected() const {}

AXRestriction AXNodeObject::Restriction() const {}

AccessibilityExpanded AXNodeObject::IsExpanded() const {}

bool AXNodeObject::IsRequired() const {}

bool AXNodeObject::CanvasHasFallbackContent() const {}

int AXNodeObject::HeadingLevel() const {}

unsigned AXNodeObject::HierarchicalLevel() const {}

String AXNodeObject::AutoComplete() const {}

// TODO(nektar): Consider removing this method in favor of
// AXInlineTextBox::GetDocumentMarkers, or add document markers to the tree data
// instead of nodes objects.
void AXNodeObject::SerializeMarkerAttributes(ui::AXNodeData* node_data) const {}

ax::mojom::blink::ListStyle AXNodeObject::GetListStyle() const {}

AXObject* AXNodeObject::InPageLinkTarget() const {}

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

AccessibilityOrientation AXNodeObject::Orientation() const {}

// According to the standard, the figcaption should only be the first or
// last child: https://html.spec.whatwg.org/#the-figcaption-element
AXObject* AXNodeObject::GetChildFigcaption() const {}

AXObject::AXObjectVector AXNodeObject::RadioButtonsInGroup() const {}

// static
HeapVector<Member<HTMLInputElement>>
AXNodeObject::FindAllRadioButtonsWithSameName(HTMLInputElement* radio_button) {}

ax::mojom::blink::WritingDirection AXNodeObject::GetTextDirection() const {}

ax::mojom::blink::TextPosition AXNodeObject::GetTextPositionFromRole() const {}

ax::mojom::blink::TextPosition AXNodeObject::GetTextPosition() const {}

void AXNodeObject::GetTextStyleAndTextDecorationStyle(
    int32_t* text_style,
    ax::mojom::blink::TextDecorationStyle* text_overline_style,
    ax::mojom::blink::TextDecorationStyle* text_strikethrough_style,
    ax::mojom::blink::TextDecorationStyle* text_underline_style) const {}

ax::mojom::blink::TextAlign AXNodeObject::GetTextAlign() const {}

float AXNodeObject::GetTextIndent() const {}

String AXNodeObject::ImageDataUrl(const gfx::Size& max_size) const {}

const AtomicString& AXNodeObject::AccessKey() const {}

RGBA32 AXNodeObject::ColorValue() const {}

RGBA32 AXNodeObject::BackgroundColor() const {}

RGBA32 AXNodeObject::GetColor() const {}

const AtomicString& AXNodeObject::ComputedFontFamily() const {}

String AXNodeObject::FontFamilyForSerialization() const {}

// Blink font size is provided in pixels.
// Platform APIs may convert to another unit (IA2 converts to points).
float AXNodeObject::FontSize() const {}

float AXNodeObject::FontWeight() const {}

ax::mojom::blink::AriaCurrentState AXNodeObject::GetAriaCurrentState() const {}

ax::mojom::blink::InvalidState AXNodeObject::GetInvalidState() const {}

bool AXNodeObject::IsValidFormControl(ListedElement* form_control) const {}

int AXNodeObject::PosInSet() const {}

int AXNodeObject::SetSize() const {}

bool AXNodeObject::ValueForRange(float* out_value) const {}

bool AXNodeObject::MaxValueForRange(float* out_value) const {}

bool AXNodeObject::MinValueForRange(float* out_value) const {}

bool AXNodeObject::StepValueForRange(float* out_value) const {}

KURL AXNodeObject::Url() const {}

AXObject* AXNodeObject::ChooserPopup() const {}

String AXNodeObject::GetValueForControl() const {}

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

String AXNodeObject::SlowGetValueForControlIncludingContentEditable() const {}

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

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

void AXNodeObject::AriaDescribedbyElements(AXObjectVector& describedby) const {}

void AXNodeObject::AriaOwnsElements(AXObjectVector& owns) const {}

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

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

bool AXNodeObject::IsEditableRoot() const {}

bool AXNodeObject::HasContentEditableAttributeSet() const {}

// Returns the nearest block-level LayoutBlockFlow ancestor
static LayoutBlockFlow* GetNearestBlockFlow(LayoutObject* object) {}

// Returns true if |r1| and |r2| are both non-null, both inline, and are
// contained within the same LayoutBlockFlow.
static bool IsInSameBlockFlow(LayoutObject* r1, LayoutObject* r2) {}

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

bool AXNodeObject::OnNativeSetSelectedAction(bool selected) {}

bool AXNodeObject::OnNativeSetValueAction(const String& string) {}

//
// New AX name calculation.
//

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

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

static bool ShouldInsertSpaceBetweenObjectsIfNeeded(
    AXObject* previous,
    AXObject* next,
    ax::mojom::blink::NameFrom last_used_name_from,
    ax::mojom::blink::NameFrom name_from) {}

String AXNodeObject::TextFromDescendants(
    AXObjectSet& visited,
    const AXObject* aria_label_or_description_root,
    bool recursive) const {}

// static
bool AXNodeObject::IsNameFromLabelElement(HTMLElement* control) {}

// static
bool AXNodeObject::IsRedundantLabel(HTMLLabelElement* label) {}

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

bool AXNodeObject::HasValidHTMLTableStructureAndLayout() const {}

void AXNodeObject::AddTableChildren() {}

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

//
// Inline text boxes.
//

bool AXNodeObject::ShouldLoadInlineTextBoxes() const {}

void AXNodeObject::LoadInlineTextBoxes() {}

void AXNodeObject::LoadInlineTextBoxesHelper() {}

void AXNodeObject::AddInlineTextBoxChildren() {}

void AXNodeObject::AddValidationMessageChild() {}

void AXNodeObject::AddImageMapChildren() {}

void AXNodeObject::AddPopupChildren() {}

void AXNodeObject::AddPseudoElementChildrenFromLayoutTree() {}

void AXNodeObject::AddNodeChildren() {}

void AXNodeObject::AddMenuListChildren() {}

void AXNodeObject::AddMenuListPopupChildren() {}

void AXNodeObject::AddAccessibleNodeChildren() {}

void AXNodeObject::AddOwnedChildren() {}

void AXNodeObject::AddChildrenImpl() {}

void AXNodeObject::AddChildren() {}

// Add non-owned children that are backed with a DOM node.
void AXNodeObject::AddNodeChild(Node* node) {}

#if DCHECK_IS_ON()
void AXNodeObject::CheckValidChild(AXObject* child) {}
#endif

void AXNodeObject::AddChild(AXObject* child, bool is_from_aria_owns) {}

void AXNodeObject::AddChildAndCheckIncluded(AXObject* child,
                                            bool is_from_aria_owns) {}

void AXNodeObject::InsertChild(AXObject* child,
                               unsigned index,
                               bool is_from_aria_owns) {}

bool AXNodeObject::CanHaveChildren() const {}

//
// Properties of the object's owning document or page.
//

double AXNodeObject::EstimatedLoadingProgress() const {}

//
// DOM and Render tree access.
//

Element* AXNodeObject::ActionElement() const {}

Element* AXNodeObject::AnchorElement() const {}

Document* AXNodeObject::GetDocument() const {}

Node* AXNodeObject::GetNode() const {}

LayoutObject* AXNodeObject::GetLayoutObject() const {}

bool AXNodeObject::HasAttribute(const QualifiedName& attribute) const {}

const AtomicString& AXNodeObject::GetAttribute(
    const QualifiedName& attribute) const {}

bool AXNodeObject::HasInternalsAttribute(Element& element,
                                         const QualifiedName& attribute) const {}

const AtomicString& AXNodeObject::GetInternalsAttribute(
    Element& element,
    const QualifiedName& attribute) const {}

bool AXNodeObject::OnNativeBlurAction() {}

bool AXNodeObject::OnNativeFocusAction() {}

bool AXNodeObject::OnNativeIncrementAction() {}

bool AXNodeObject::OnNativeDecrementAction() {}

bool AXNodeObject::OnNativeSetSequentialFocusNavigationStartingPointAction() {}

void AXNodeObject::SelectedOptions(AXObjectVector& options) const {}

//
// Notifications that this object may have changed.
//

void AXNodeObject::HandleAriaExpandedChanged() {}

void AXNodeObject::HandleActiveDescendantChanged() {}

AXObject::AXObjectVector AXNodeObject::ErrorMessage() const {}

AXObject::AXObjectVector AXNodeObject::ErrorMessageFromAria() const {}

AXObject::AXObjectVector AXNodeObject::ErrorMessageFromHTML() const {}

String AXNodeObject::TextAlternativeFromTooltip(
    ax::mojom::blink::NameFrom& name_from,
    NameSources* name_sources,
    bool* found_text_alternative,
    String* text_alternative,
    AXRelatedObjectVector* related_objects) const {}

String AXNodeObject::TextAlternativeFromTitleAttribute(
    const AtomicString& title,
    ax::mojom::blink::NameFrom& name_from,
    NameSources* name_sources,
    bool* found_text_alternative) const {}

// Based on
// https://www.w3.org/TR/html-aam-1.0/#accessible-name-and-description-computation
String AXNodeObject::NativeTextAlternative(
    AXObjectSet& visited,
    ax::mojom::blink::NameFrom& name_from,
    AXRelatedObjectVector* related_objects,
    NameSources* name_sources,
    bool* found_text_alternative) const {}

// static
String AXNodeObject::GetSavedTextAlternativeFromNameSource(
    bool found_text_alternative,
    ax::mojom::NameFrom& name_from,
    AXRelatedObjectVector* related_objects,
    NameSources* name_sources) {}

// This is not part of the spec, but we think it's a worthy addition: if the
// labelled input is of type="file", we append the chosen file name to it. We do
// this because this type of input is actually exposed as a button, and buttons
// may not have a "value" field. An unlabelled input is manager later in this
// function, it's named with the default text in the button, 'Choose File', plus
// the file name.
String AXNodeObject::MaybeAppendFileDescriptionToName(
    const String& name) const {}

bool AXNodeObject::ShouldIncludeContentInTextAlternative(
    bool recursive,
    const AXObject* aria_label_or_description_root,
    AXObjectSet& visited) const {}

String AXNodeObject::Description(
    ax::mojom::blink::NameFrom name_from,
    ax::mojom::blink::DescriptionFrom& description_from,
    AXObjectVector* description_objects) const {}

// Based on
// http://rawgit.com/w3c/aria/master/html-aam/html-aam.html#accessible-name-and-description-calculation
String AXNodeObject::Description(
    ax::mojom::blink::NameFrom name_from,
    ax::mojom::blink::DescriptionFrom& description_from,
    DescriptionSources* description_sources,
    AXRelatedObjectVector* related_objects) const {}

String AXNodeObject::SVGDescription(
    ax::mojom::blink::NameFrom name_from,
    ax::mojom::blink::DescriptionFrom& description_from,
    DescriptionSources* description_sources,
    AXRelatedObjectVector* related_objects) const {}

String AXNodeObject::Placeholder(ax::mojom::blink::NameFrom name_from) const {}

String AXNodeObject::Title(ax::mojom::blink::NameFrom name_from) const {}

String AXNodeObject::PlaceholderFromNativeAttribute() const {}

String AXNodeObject::GetValueContributionToName(AXObjectSet& visited) const {}

bool AXNodeObject::UseNameFromSelectedOption() const {}

ScrollableArea* AXNodeObject::GetScrollableAreaIfScrollable() const {}

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

AXObject* AXNodeObject::AccessibilityImageMapHitTest(
    HTMLAreaElement* area,
    const gfx::Point& point) const {}

AXObject* AXNodeObject::GetFirstInlineBlockOrDeepestInlineAXChildInLayoutTree(
    AXObject* start_object,
    bool first) const {}

void AXNodeObject::MaybeResetCache() const {}

void AXNodeObject::GenerationalCache::Trace(Visitor* visitor) const {}

AXObject* AXNodeObject::SetNextOnLine(AXObject* next_on_line) const {}

AXObject* AXNodeObject::SetPreviousOnLine(AXObject* previous_on_line) const {}

AXObject* AXNodeObject::NextOnLine() const {}

AXObject* AXNodeObject::PreviousOnLine() const {}

void AXNodeObject::HandleAutofillSuggestionAvailabilityChanged(
    WebAXAutofillSuggestionAvailability suggestion_availability) {}

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

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

}  // namespace blink