Bug 1275493 - Do not update <select> field while keying through items in dropdown with non-e10s on OS X and GTK. r?Enn draft
authorMike Conley <mconley@mozilla.com>
Tue, 30 Aug 2016 17:47:10 -0400
changeset 408106 d3003ff9b35cc0a3d23083cc630bebedfe3cef2c
parent 407496 b18c8bcdc116eef8799880b7c50317bf54218474
child 530046 0820bab0d151b7134f42fa387c7920ae9df79149
push id28147
push usermconley@mozilla.com
push dateWed, 31 Aug 2016 18:24:53 +0000
reviewersEnn
bugs1275493
milestone51.0a1
Bug 1275493 - Do not update <select> field while keying through items in dropdown with non-e10s on OS X and GTK. r?Enn MozReview-Commit-ID: D5PBEj9MMW2
layout/forms/nsListControlFrame.cpp
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -1311,20 +1311,29 @@ nsListControlFrame::ToggleOptionSelected
 // Dispatch event and such
 bool
 nsListControlFrame::UpdateSelection()
 {
   if (mIsAllFramesHere) {
     // if it's a combobox, display the new text
     nsWeakFrame weakFrame(this);
     if (mComboboxFrame) {
+#if defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
+      // For GTK and OS X, we do not update the combobox
+      // while the dropdown is open and the user is updating
+      // their selection.
+      if (!mComboboxFrame->IsDroppedDown()) {
+        mComboboxFrame->RedisplaySelectedText();
+      }
+#else
       mComboboxFrame->RedisplaySelectedText();
+#endif
 
-      // When dropdown list is open, onchange event will be fired when Enter key
-      // is hit or when dropdown list is dismissed.
+      // When dropdown list is open, onchange event will be fired when
+      // Enter key is hit or when dropdown list is dismissed.
       if (mComboboxFrame->IsDroppedDown()) {
         return weakFrame.IsAlive();
       }
     }
     if (mIsAllContentHere) {
       FireOnInputAndOnChange();
     }
     return weakFrame.IsAlive();