summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/accessibility/ax_relation_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/accessibility/ax_relation_cache.h')
-rw-r--r--chromium/third_party/blink/renderer/modules/accessibility/ax_relation_cache.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_relation_cache.h b/chromium/third_party/blink/renderer/modules/accessibility/ax_relation_cache.h
index 6c3af3d9bc4..c843dfe1d5e 100644
--- a/chromium/third_party/blink/renderer/modules/accessibility/ax_relation_cache.h
+++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_relation_cache.h
@@ -35,6 +35,9 @@ class AXRelationCache {
const Vector<String>& id_vector,
HeapVector<Member<AXObject>>& owned_children);
+ // Return true if any label ever pointed to the element via the for attribute.
+ bool MayHaveHTMLLabelViaForAttribute(const HTMLElement&);
+
// Given an element in the DOM tree that was either just added or whose id
// just changed, check to see if another object wants to be its parent due to
// aria-owns. If so, update the tree by calling childrenChanged() on the
@@ -51,6 +54,8 @@ class AXRelationCache {
void UpdateReverseRelations(const AXObject* relation_source,
const Vector<String>& target_ids);
+ void LabelChanged(Node*);
+
private:
// If any object is related to this object via <label for>, aria-owns,
// aria-describedby or aria-labeledby, update the text for the related object.
@@ -87,13 +92,19 @@ class AXRelationCache {
// and fire the appropriate change events.
HashMap<String, HashSet<AXID>> id_attr_to_related_mapping_;
+ // HTML id attributes that at one time havehad a <label for> pointing to it.
+ // IDs are not necessarily removed from this set. It is not necessary to
+ // remove IDs as false positives are ok. Being able to determine that a
+ // labelable element has never had an associated label allows the accessible
+ // name calculation to be optimized.
+ HashSet<AtomicString> all_previously_seen_label_target_ids_;
+
// Helpers that call back into object cache
AXObject* ObjectFromAXID(AXID) const;
AXObject* GetOrCreate(Node*);
AXObject* Get(Node*);
void ChildrenChanged(AXObject*);
void TextChanged(AXObject*);
- void LabelChanged(Node*);
DISALLOW_COPY_AND_ASSIGN(AXRelationCache);
};