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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.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
Index: third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp b/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp
index 7ef8e0e8ba2061cd30cbb8226e310ee49dffb720..f78cb7700d506e2aec4cd5181418b1aa3ada5343 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp
@@ -124,13 +124,20 @@ void AXMenuListPopup::UpdateChildrenIfNecessary() {
AddChildren();
}
-void AXMenuListPopup::DidUpdateActiveOption(int option_index) {
+void AXMenuListPopup::DidUpdateActiveOption(int option_index,
+ bool fire_notifications) {
UpdateChildrenIfNecessary();
+ int old_index = active_index_;
+ active_index_ = option_index;
+
+ if (!fire_notifications)
+ return;
+
AXObjectCacheImpl& cache = AxObjectCache();
- if (active_index_ != option_index && active_index_ >= 0 &&
- active_index_ < static_cast<int>(children_.size())) {
- AXObjectImpl* previous_child = children_[active_index_].Get();
+ if (old_index != option_index && old_index >= 0 &&
+ old_index < static_cast<int>(children_.size())) {
+ AXObjectImpl* previous_child = children_[old_index].Get();
cache.PostNotification(previous_child,
AXObjectCacheImpl::kAXMenuListItemUnselected);
}
@@ -140,8 +147,6 @@ void AXMenuListPopup::DidUpdateActiveOption(int option_index) {
cache.PostNotification(this, AXObjectCacheImpl::kAXActiveDescendantChanged);
cache.PostNotification(child, AXObjectCacheImpl::kAXMenuListItemSelected);
}
-
- active_index_ = option_index;
}
void AXMenuListPopup::DidHide() {

Powered by Google App Engine
This is Rietveld 408576698