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

Unified Diff: Source/modules/accessibility/AXMenuList.cpp

Issue 1059503002: Re-land: Don't keep recreating AXMenuListPopup (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@suppress_extra_events
Patch Set: Clean up code Created 5 years, 8 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: Source/modules/accessibility/AXMenuList.cpp
diff --git a/Source/modules/accessibility/AXMenuList.cpp b/Source/modules/accessibility/AXMenuList.cpp
index 6e7b9029e772a95f4086403772897897586fbb47..801aca2760e7579644e06fd8bbb1d6373a25d375 100644
--- a/Source/modules/accessibility/AXMenuList.cpp
+++ b/Source/modules/accessibility/AXMenuList.cpp
@@ -60,6 +60,20 @@ bool AXMenuList::press() const
return true;
}
+void AXMenuList::updateChildrenIfNecessary()
+{
+ if (m_children.isEmpty()) {
+ addChildren();
+ return;
+ }
+
+ // There's no reason to update our AXMenuListPopup child. If we get a
+ // call to updateChildrenIfNecessary, it's because the options might have
+ // changed, so call it on our popup.
+ ASSERT(m_children.size() == 1);
+ m_children[0]->updateChildrenIfNecessary();
+}
+
void AXMenuList::clearChildren()
{
if (m_children.isEmpty())

Powered by Google App Engine
This is Rietveld 408576698