chromium/third_party/blink/renderer/modules/accessibility/ax_relation_cache.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/modules/accessibility/ax_relation_cache.h"

#include "base/memory/ptr_util.h"
#include "third_party/blink/renderer/core/aom/accessible_node.h"
#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
#include "third_party/blink/renderer/core/dom/shadow_including_tree_order_traversal.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/html_area_element.h"
#include "third_party/blink/renderer/core/html/html_body_element.h"
#include "third_party/blink/renderer/core/html/html_br_element.h"
#include "ui/accessibility/ax_common.h"

namespace blink {

AXRelationCache::AXRelationCache(AXObjectCacheImpl* object_cache)
    :{}

AXRelationCache::~AXRelationCache() = default;

void AXRelationCache::Init() {}

void AXRelationCache::DoInitialDocumentScan(Document& document) {}

void AXRelationCache::CacheRelationIds(Element& element) {}

#if DCHECK_IS_ON()
void AXRelationCache::CheckRelationsCached(Element& element) {}

void AXRelationCache::CheckElementWasProcessed(Element& element) {}
#endif

void AXRelationCache::ProcessUpdatesWithCleanLayout() {}

bool AXRelationCache::IsDirty() const {}

bool AXRelationCache::IsAriaOwned(const AXObject* child, bool check) const {}

AXObject* AXRelationCache::GetAriaOwnedParent(const AXObject* child) const {}

AXObject* AXRelationCache::ValidatedAriaOwner(const AXObject* child) {}

Vector<String> AXRelationCache::GetTextRelationIds(Element& relation_source) {}

// Update reverse relation map, where relation_source is related to target_ids.
// TODO Support when HasExplicitlySetAttrAssociatedElement() == true.
void AXRelationCache::UpdateReverseRelations(
    HashMap<String, HashSet<DOMNodeId>>& id_attr_to_node_map,
    Node* relation_source,
    const Vector<String>& target_ids) {}

void AXRelationCache::UpdateReverseTextRelations(Element& relation_source) {}

void AXRelationCache::UpdateReverseTextRelations(
    Element& relation_source,
    const QualifiedName& attr_name) {}

void AXRelationCache::UpdateReverseTextRelations(
    Element& relation_source,
    const Vector<String>& target_ids) {}

void AXRelationCache::UpdateReverseActiveDescendantRelations(
    Element& relation_source) {}

void AXRelationCache::UpdateReverseOwnsRelations(Element& relation_source) {}

// ContainsCycle() should:
// * Return true when a cycle is an authoring error, but not an error in Blink.
// * CHECK(false) when Blink should have caught this error earlier ... we should
// have never gotten into this state.
//
// For example, if a web page specifies that grandchild owns it's grandparent,
// what should happen is the ContainsCycle will start at the grandchild and go
// up, finding that it's grandparent is already in the ancestor chain, and
// return false, thus disallowing the relation. However, if on the way to the
// root, it discovers that any other two objects are repeated in the ancestor
// chain, this is unexpected, and results in the CHECK(false) condition.
static bool ContainsCycle(AXObject* owner, Node& child_node) {}

bool AXRelationCache::IsValidOwnsRelation(AXObject* owner,
                                          Node& child_node) const {}

// static
bool AXRelationCache::IsValidOwner(AXObject* owner) {}

// static
bool AXRelationCache::IsValidOwnedChild(Node& child_node) {}

void AXRelationCache::UnmapOwnedChildrenWithCleanLayout(
    const AXObject* owner,
    const Vector<AXID>& removed_child_ids,
    Vector<AXID>& unparented_child_ids) {}

void AXRelationCache::MapOwnedChildrenWithCleanLayout(
    const AXObject* owner,
    const Vector<AXID>& child_ids) {}

void AXRelationCache::UpdateAriaOwnsFromAttrAssociatedElementsWithCleanLayout(
    AXObject* owner,
    const HeapVector<Member<Element>>& attr_associated_elements,
    HeapVector<Member<AXObject>>& validated_owned_children_result,
    bool force) {}

void AXRelationCache::ValidatedAriaOwnedChildren(
    const AXObject* owner,
    HeapVector<Member<AXObject>>& validated_owned_children_result) {}

void AXRelationCache::UpdateAriaOwnsWithCleanLayout(AXObject* owner,
                                                    bool force) {}

void AXRelationCache::UpdateAriaOwnerToChildrenMappingWithCleanLayout(
    AXObject* owner,
    HeapVector<Member<AXObject>>& validated_owned_children_result,
    bool force) {}

bool AXRelationCache::MayHaveHTMLLabelViaForAttribute(
    const HTMLElement& labelable) {}

bool AXRelationCache::IsARIALabelOrDescription(Element& element) {}

// Fill source_objects with AXObjects for relations pointing to target.
void AXRelationCache::GetReverseRelated(
    Node* target,
    HashMap<String, HashSet<DOMNodeId>>& id_attr_to_node_map,
    HeapVector<Member<AXObject>>& source_objects) {}

AXObject* AXRelationCache::GetOrCreateAriaOwnerFor(Node* node, AXObject* obj) {}

void AXRelationCache::UpdateRelatedTree(Node* node, AXObject* obj) {}

void AXRelationCache::UpdateRelatedText(Node* node) {}

void AXRelationCache::UpdateRelatedActiveDescendant(Node* node) {}

void AXRelationCache::RemoveAXID(AXID obj_id) {}

void AXRelationCache::RemoveOwnedRelation(AXID obj_id) {}

AXObject* AXRelationCache::ObjectFromAXID(AXID axid) const {}

AXObject* AXRelationCache::Get(Node* node) {}

AXObject* AXRelationCache::GetOrCreate(Node* node, const AXObject* owner) {}

void AXRelationCache::ChildrenChangedWithCleanLayout(AXObject* object) {}

Node* AXRelationCache::LabelChanged(HTMLLabelElement& label) {}

void AXRelationCache::MaybeRestoreParentOfOwnedChild(AXID removed_child_axid) {}

void AXRelationCache::RegisterIncompleteRelation(
    AXObject* source,
    const QualifiedName& relation_attr) {}

void AXRelationCache::RegisterIncompleteRelations(AXObject* source) {}

void AXRelationCache::ProcessCompletedRelationsForNewId(
    const AtomicString& id) {}

}  // namespace blink