#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) { … }
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) { … }
static bool ContainsCycle(AXObject* owner, Node& child_node) { … }
bool AXRelationCache::IsValidOwnsRelation(AXObject* owner,
Node& child_node) const { … }
bool AXRelationCache::IsValidOwner(AXObject* owner) { … }
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) { … }
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) { … }
}