Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp

Issue 2957733002: Only call TextChanged on existing AXObjects. This avoids triggering the code which calls UpdateDist… (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
index 1b6ab5ef6c28c75678b977f027a140049ba61dc1..15c14aa20fa614c2ca42dfdf146b3c810b8b3b67 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
@@ -568,24 +568,29 @@ void AXObjectCacheImpl::RemoveAXID(AXObjectImpl* object) {
aria_owner_to_ids_mapping_.erase(obj_id);
}
-void AXObjectCacheImpl::SelectionChanged(Node* node) {
+AXObjectImpl* AXObjectCacheImpl::NearestExistingAncestor(Node* node) {
// Find the nearest ancestor that already has an accessibility object, since
// we might be in the middle of a layout.
while (node) {
- if (AXObjectImpl* obj = Get(node)) {
- obj->SelectionChanged();
- return;
- }
+ if (AXObjectImpl* obj = Get(node))
+ return obj;
node = node->parentNode();
}
+ return nullptr;
+}
+
+void AXObjectCacheImpl::SelectionChanged(Node* node) {
+ AXObjectImpl* nearestAncestor = NearestExistingAncestor(node);
+ if (nearestAncestor)
+ nearestAncestor->SelectionChanged();
}
void AXObjectCacheImpl::TextChanged(Node* node) {
- TextChanged(GetOrCreate(node));
+ TextChanged(Get(node));
}
void AXObjectCacheImpl::TextChanged(LayoutObject* layout_object) {
- TextChanged(GetOrCreate(layout_object));
+ TextChanged(Get(layout_object));
}
void AXObjectCacheImpl::TextChanged(AXObjectImpl* obj) {
@@ -1155,7 +1160,7 @@ void AXObjectCacheImpl::HandleValueChanged(Node* node) {
void AXObjectCacheImpl::HandleUpdateActiveMenuOption(LayoutMenuList* menu_list,
int option_index) {
- AXObjectImpl* obj = Get(menu_list);
+ AXObjectImpl* obj = GetOrCreate(menu_list);
if (!obj || !obj->IsMenuList())
return;
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698