From c491890f51a81f0e2f7f88790fa5d9e0be4185ea Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Tue, 26 Apr 2016 14:43:55 +0200 Subject: [PATCH] Bug 623432 part 2 - Ignore scrollbars while drag-selecting content. r=tn --- layout/generic/nsFrame.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 78265312ce3b..5892a0d92e70 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -3553,16 +3553,16 @@ NS_IMETHODIMP nsFrame::HandleDrag(nsPresContext* aPresContext, MOZ_ASSERT(aEvent->mClass == eMouseEventClass, "HandleDrag can only handle mouse event"); - bool selectable; - IsSelectable(&selectable, nullptr); - - // XXX Do we really need to exclude non-selectable content here? - // GetContentOffsetsFromPoint can handle it just fine, although some - // other stuff might not like it. - if (!selectable) - return NS_OK; - if (DisplaySelection(aPresContext) == nsISelectionController::SELECTION_OFF) { - return NS_OK; + nsIFrame* scrollbar = + nsLayoutUtils::GetClosestFrameOfType(this, nsGkAtoms::scrollbarFrame); + if (!scrollbar) { + // XXX Do we really need to exclude non-selectable content here? + // GetContentOffsetsFromPoint can handle it just fine, although some + // other stuff might not like it. + // NOTE: DisplaySelection() returns SELECTION_OFF for non-selectable frames. + if (DisplaySelection(aPresContext) == nsISelectionController::SELECTION_OFF) { + return NS_OK; + } } nsIPresShell *presShell = aPresContext->PresShell();