From bc6893b6ba389b92fe68bb92d9b1eea017d13073 Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Tue, 26 Apr 2005 03:14:38 +0000 Subject: [PATCH] Bug 291443. Listboxes should always direct mouse capture to their scrolled frame, to ensure that events reach the DOM event listener. r+sr=bzbarsky,a=chofmann --- layout/forms/nsListControlFrame.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index 4a85769f7408..47b3855c8226 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -1365,20 +1365,7 @@ nsListControlFrame::CaptureMouseEvents(nsPresContext* aPresContext, PRBool aGrab if (aGrabMouseEvents && IsInDropDownMode() && nsComboboxControlFrame::ToolkitHasNativePopup()) return NS_OK; - nsIView* view = nsnull; - if (IsInDropDownMode()) { - view = GetView(); - } else { - nsIFrame* scrolledFrame = GetScrolledFrame(); - NS_ASSERTION(scrolledFrame, "No scrolled frame found"); - NS_ENSURE_TRUE(scrolledFrame, NS_ERROR_FAILURE); - - nsIFrame* scrollport = scrolledFrame->GetParent(); - NS_ASSERTION(scrollport, "No scrollport found"); - NS_ENSURE_TRUE(scrollport, NS_ERROR_FAILURE); - - view = scrollport->GetView(); - } + nsIView* view = GetScrolledFrame()->GetView(); NS_ASSERTION(view, "no view???"); NS_ENSURE_TRUE(view, NS_ERROR_FAILURE);