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
--- 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) {