chromium/third_party/blink/renderer/core/aom/accessible_node.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/aom/accessible_node.h"

#include "base/ranges/algorithm.h"
#include "third_party/blink/renderer/core/accessibility/ax_object_cache.h"
#include "third_party/blink/renderer/core/aom/accessible_node_list.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/qualified_name.h"
#include "third_party/blink/renderer/core/event_target_names.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.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/html/custom/element_internals.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"

namespace blink {

namespace {

QualifiedName GetCorrespondingARIAAttribute(AOMStringProperty property) {}

QualifiedName GetCorrespondingARIAAttribute(AOMRelationProperty property) {}

QualifiedName GetCorrespondingARIAAttribute(AOMRelationListProperty property) {}

QualifiedName GetCorrespondingARIAAttribute(AOMBooleanProperty property) {}

QualifiedName GetCorrespondingARIAAttribute(AOMFloatProperty property) {}

QualifiedName GetCorrespondingARIAAttribute(AOMUIntProperty property) {}

QualifiedName GetCorrespondingARIAAttribute(AOMIntProperty property) {}

}  // namespace

AccessibleNode::AccessibleNode(Element* element)
    :{}

AccessibleNode::AccessibleNode(Document& document)
    :{}

AccessibleNode::~AccessibleNode() = default;

// static
AccessibleNode* AccessibleNode::Create(Document& document) {}

Document* AccessibleNode::GetDocument() const {}

const AtomicString& AccessibleNode::GetProperty(
    AOMStringProperty property) const {}

// static
AccessibleNode* AccessibleNode::GetProperty(Element* element,
                                            AOMRelationProperty property) {}

// static
AccessibleNodeList* AccessibleNode::GetProperty(
    Element* element,
    AOMRelationListProperty property) {}

// static
bool AccessibleNode::GetProperty(Element* element,
                                 AOMRelationListProperty property,
                                 HeapVector<Member<Element>>& targets) {}

template <typename P, typename T>
static std::optional<T> FindPropertyValue(
    P property,
    const Vector<std::pair<P, T>>& properties) {}

std::optional<bool> AccessibleNode::GetProperty(
    AOMBooleanProperty property) const {}

// static
std::optional<int32_t> AccessibleNode::GetProperty(Element* element,
                                                   AOMIntProperty property) {}

// static
std::optional<uint32_t> AccessibleNode::GetProperty(Element* element,
                                                    AOMUIntProperty property) {}

// static
std::optional<float> AccessibleNode::GetProperty(Element* element,
                                                 AOMFloatProperty property) {}

bool AccessibleNode::IsUndefinedAttrValue(const AtomicString& value) {}

// static
const AtomicString& AccessibleNode::GetElementOrInternalsARIAAttribute(
    Element& element,
    const QualifiedName& attribute,
    bool is_token_attr) {}

// static
const AtomicString& AccessibleNode::GetPropertyOrARIAAttribute(
    Element* element,
    AOMStringProperty property) {}

// static
const AtomicString& AccessibleNode::GetPropertyOrARIAAttributeValue(
    Element* element,
    AOMRelationProperty property) {}

Element* AccessibleNode::GetPropertyOrARIAAttribute(
    Element* element,
    AOMRelationProperty property) {}

// static
bool AccessibleNode::GetPropertyOrARIAAttribute(
    Element* element,
    AOMRelationListProperty property,
    HeapVector<Member<Element>>& targets) {}

// static
bool AccessibleNode::GetPropertyOrARIAAttribute(Element* element,
                                                AOMBooleanProperty property,
                                                bool& is_null) {}

// static
float AccessibleNode::GetPropertyOrARIAAttribute(Element* element,
                                                 AOMFloatProperty property,
                                                 bool& is_null) {}

// static
uint32_t AccessibleNode::GetPropertyOrARIAAttribute(Element* element,
                                                    AOMUIntProperty property,
                                                    bool& is_null) {}

// static
int32_t AccessibleNode::GetPropertyOrARIAAttribute(Element* element,
                                                   AOMIntProperty property,
                                                   bool& is_null) {}

void AccessibleNode::GetAllAOMProperties(AOMPropertyClient* client) {}

AccessibleNode* AccessibleNode::activeDescendant() const {}

void AccessibleNode::setActiveDescendant(AccessibleNode* active_descendant) {}

std::optional<bool> AccessibleNode::atomic() const {}

void AccessibleNode::setAtomic(std::optional<bool> value) {}

AtomicString AccessibleNode::autocomplete() const {}

void AccessibleNode::setAutocomplete(const AtomicString& autocomplete) {}

std::optional<bool> AccessibleNode::busy() const {}

void AccessibleNode::setBusy(std::optional<bool> value) {}

AtomicString AccessibleNode::brailleLabel() const {}

void AccessibleNode::setBrailleLabel(const AtomicString& braille_label) {}

AtomicString AccessibleNode::brailleRoleDescription() const {}

void AccessibleNode::setBrailleRoleDescription(
    const AtomicString& braille_role_description) {}

AtomicString AccessibleNode::checked() const {}

void AccessibleNode::setChecked(const AtomicString& checked) {}

std::optional<int32_t> AccessibleNode::colCount() const {}

void AccessibleNode::setColCount(std::optional<int32_t> value) {}

std::optional<uint32_t> AccessibleNode::colIndex() const {}

void AccessibleNode::setColIndex(std::optional<uint32_t> value) {}

AtomicString AccessibleNode::colIndexText() const {}

void AccessibleNode::setColIndexText(const AtomicString& value) {}

std::optional<uint32_t> AccessibleNode::colSpan() const {}

void AccessibleNode::setColSpan(std::optional<uint32_t> value) {}

AccessibleNodeList* AccessibleNode::controls() const {}

void AccessibleNode::setControls(AccessibleNodeList* controls) {}

AtomicString AccessibleNode::current() const {}

void AccessibleNode::setCurrent(const AtomicString& current) {}

AccessibleNodeList* AccessibleNode::describedBy() {}

void AccessibleNode::setDescribedBy(AccessibleNodeList* described_by) {}

AtomicString AccessibleNode::description() const {}

void AccessibleNode::setDescription(const AtomicString& description) {}

AccessibleNodeList* AccessibleNode::details() const {}

void AccessibleNode::setDetails(AccessibleNodeList* details) {}

std::optional<bool> AccessibleNode::disabled() const {}

void AccessibleNode::setDisabled(std::optional<bool> value) {}

AccessibleNodeList* AccessibleNode::errorMessage() const {}

void AccessibleNode::setErrorMessage(AccessibleNodeList* error_messages) {}

std::optional<bool> AccessibleNode::expanded() const {}

void AccessibleNode::setExpanded(std::optional<bool> value) {}

AccessibleNodeList* AccessibleNode::flowTo() const {}

void AccessibleNode::setFlowTo(AccessibleNodeList* flow_to) {}

AtomicString AccessibleNode::hasPopup() const {}

void AccessibleNode::setHasPopup(const AtomicString& has_popup) {}

std::optional<bool> AccessibleNode::hidden() const {}

void AccessibleNode::setHidden(std::optional<bool> value) {}

AtomicString AccessibleNode::invalid() const {}

void AccessibleNode::setInvalid(const AtomicString& invalid) {}

AtomicString AccessibleNode::keyShortcuts() const {}

void AccessibleNode::setKeyShortcuts(const AtomicString& key_shortcuts) {}

AtomicString AccessibleNode::label() const {}

void AccessibleNode::setLabel(const AtomicString& label) {}

AccessibleNodeList* AccessibleNode::labeledBy() {}

void AccessibleNode::setLabeledBy(AccessibleNodeList* labeled_by) {}

std::optional<uint32_t> AccessibleNode::level() const {}

void AccessibleNode::setLevel(std::optional<uint32_t> value) {}

AtomicString AccessibleNode::live() const {}

void AccessibleNode::setLive(const AtomicString& live) {}

std::optional<bool> AccessibleNode::modal() const {}

void AccessibleNode::setModal(std::optional<bool> value) {}

std::optional<bool> AccessibleNode::multiline() const {}

void AccessibleNode::setMultiline(std::optional<bool> value) {}

std::optional<bool> AccessibleNode::multiselectable() const {}

void AccessibleNode::setMultiselectable(std::optional<bool> value) {}

AtomicString AccessibleNode::orientation() const {}

void AccessibleNode::setOrientation(const AtomicString& orientation) {}

AccessibleNodeList* AccessibleNode::owns() const {}

void AccessibleNode::setOwns(AccessibleNodeList* owns) {}

AtomicString AccessibleNode::placeholder() const {}

void AccessibleNode::setPlaceholder(const AtomicString& placeholder) {}

std::optional<uint32_t> AccessibleNode::posInSet() const {}

void AccessibleNode::setPosInSet(std::optional<uint32_t> value) {}

AtomicString AccessibleNode::pressed() const {}

void AccessibleNode::setPressed(const AtomicString& pressed) {}

std::optional<bool> AccessibleNode::readOnly() const {}

void AccessibleNode::setReadOnly(std::optional<bool> value) {}

AtomicString AccessibleNode::relevant() const {}

void AccessibleNode::setRelevant(const AtomicString& relevant) {}

std::optional<bool> AccessibleNode::required() const {}

void AccessibleNode::setRequired(std::optional<bool> value) {}

AtomicString AccessibleNode::role() const {}

void AccessibleNode::setRole(const AtomicString& role) {}

AtomicString AccessibleNode::roleDescription() const {}

void AccessibleNode::setRoleDescription(const AtomicString& role_description) {}

std::optional<int32_t> AccessibleNode::rowCount() const {}

void AccessibleNode::setRowCount(std::optional<int32_t> value) {}

std::optional<uint32_t> AccessibleNode::rowIndex() const {}

void AccessibleNode::setRowIndex(std::optional<uint32_t> value) {}

AtomicString AccessibleNode::rowIndexText() const {}

void AccessibleNode::setRowIndexText(const AtomicString& value) {}

std::optional<uint32_t> AccessibleNode::rowSpan() const {}

void AccessibleNode::setRowSpan(std::optional<uint32_t> value) {}

std::optional<bool> AccessibleNode::selected() const {}

void AccessibleNode::setSelected(std::optional<bool> value) {}

std::optional<int32_t> AccessibleNode::setSize() const {}

void AccessibleNode::setSetSize(std::optional<int32_t> value) {}

AtomicString AccessibleNode::sort() const {}

void AccessibleNode::setSort(const AtomicString& sort) {}

std::optional<float> AccessibleNode::valueMax() const {}

void AccessibleNode::setValueMax(std::optional<float> value) {}

std::optional<float> AccessibleNode::valueMin() const {}

void AccessibleNode::setValueMin(std::optional<float> value) {}

std::optional<float> AccessibleNode::valueNow() const {}

void AccessibleNode::setValueNow(std::optional<float> value) {}

AtomicString AccessibleNode::valueText() const {}

void AccessibleNode::setValueText(const AtomicString& value_text) {}

AtomicString AccessibleNode::virtualContent() const {}

void AccessibleNode::setVirtualContent(const AtomicString& virtual_content) {}

AccessibleNodeList* AccessibleNode::childNodes() {}

void AccessibleNode::appendChild(AccessibleNode* child,
                                 ExceptionState& exception_state) {}

void AccessibleNode::DetachedFromDocument() {}

void AccessibleNode::removeChild(AccessibleNode* old_child,
                                 ExceptionState& exception_state) {}

// These properties support a list of tokens, and "undefined"/"" is
// equivalent to not setting the attribute.
bool AccessibleNode::IsStringTokenProperty(AOMStringProperty property) {}

const AtomicString& AccessibleNode::InterfaceName() const {}

ExecutionContext* AccessibleNode::GetExecutionContext() const {}

Document* AccessibleNode::GetAncestorDocument() {}

void AccessibleNode::SetStringProperty(AOMStringProperty property,
                                       const AtomicString& value) {}

void AccessibleNode::SetRelationProperty(AOMRelationProperty property,
                                         AccessibleNode* value) {}

void AccessibleNode::SetRelationListProperty(AOMRelationListProperty property,
                                             AccessibleNodeList* value) {}

template <typename P, typename T>
static void SetProperty(P property,
                        std::optional<T> value,
                        Vector<std::pair<P, T>>& properties) {}

void AccessibleNode::SetBooleanProperty(AOMBooleanProperty property,
                                        std::optional<bool> value) {}

void AccessibleNode::SetIntProperty(AOMIntProperty property,
                                    std::optional<int32_t> value) {}

void AccessibleNode::SetUIntProperty(AOMUIntProperty property,
                                     std::optional<uint32_t> value) {}

void AccessibleNode::SetFloatProperty(AOMFloatProperty property,
                                      std::optional<float> value) {}

void AccessibleNode::OnRelationListChanged(AOMRelationListProperty property) {}

void AccessibleNode::NotifyAttributeChanged(
    const blink::QualifiedName& attribute) {}

AXObjectCache* AccessibleNode::GetAXObjectCache() {}

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

}  // namespace blink