Bug 1258820 - making root scrollable element not scroll if mouse wheel is used on xul dropdown r=masayuki
authorArata Furukawa <old.river.new@gmail.com>
Sat, 26 Mar 2016 14:29:01 +0900
changeset 290565 d05645511500d7333299defb3f935fe027c3dcf1
parent 290564 82d365a9a1b49f841b843ef6c5b51ed94f929ad1
child 290566 605b1a8fa215870ea78b60e524750d6877bf1987
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1258820
milestone48.0a1
Bug 1258820 - making root scrollable element not scroll if mouse wheel is used on xul dropdown r=masayuki EventStateManager::ComputeScrollTarget() should stop looking for scrollable frame if it meets nsMenuPopupFrame because the user must not want to scroll outside the popup. MozReview-Commit-ID: Jo1QaQuSzKS
dom/events/EventStateManager.cpp
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -46,16 +46,17 @@
 #include "nsFrameSelection.h"
 #include "nsPIDOMWindow.h"
 #include "nsPIWindowRoot.h"
 #include "nsIWebNavigation.h"
 #include "nsIContentViewer.h"
 #include "nsFrameManager.h"
 #include "nsITabChild.h"
 #include "nsPluginFrame.h"
+#include "nsMenuPopupFrame.h"
 
 #include "nsIDOMXULElement.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIObserverService.h"
 #include "nsIDocShell.h"
 #include "nsIDOMWheelEvent.h"
 #include "nsIDOMUIEvent.h"
 #include "nsIMozBrowserFrame.h"
@@ -2433,16 +2434,20 @@ EventStateManager::ComputeScrollTarget(n
       // action.
       if (aOptions & INCLUDE_PLUGIN_AS_TARGET) {
         nsPluginFrame* pluginFrame = do_QueryFrame(scrollFrame);
         if (pluginFrame &&
             pluginFrame->WantsToHandleWheelEventAsDefaultAction()) {
           return scrollFrame;
         }
       }
+      nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(scrollFrame);
+      if (menuPopupFrame) {
+        return nullptr;
+      }
       continue;
     }
 
     nsIFrame* frameToScroll = do_QueryFrame(scrollableFrame);
     MOZ_ASSERT(frameToScroll);
 
     // Don't scroll vertically by mouse-wheel on a single-line text control.
     if (checkIfScrollableY) {