Bug 623432 part 2 - Ignore scrollbars while drag-selecting content. r=tn

This commit is contained in:
Mats Palmgren 2016-04-26 14:43:55 +02:00
Родитель 36610cc2fe
Коммит c491890f51
1 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -3553,17 +3553,17 @@ NS_IMETHODIMP nsFrame::HandleDrag(nsPresContext* aPresContext,
MOZ_ASSERT(aEvent->mClass == eMouseEventClass,
"HandleDrag can only handle mouse event");
bool selectable;
IsSelectable(&selectable, nullptr);
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.
if (!selectable)
return NS_OK;
// NOTE: DisplaySelection() returns SELECTION_OFF for non-selectable frames.
if (DisplaySelection(aPresContext) == nsISelectionController::SELECTION_OFF) {
return NS_OK;
}
}
nsIPresShell *presShell = aPresContext->PresShell();
RefPtr<nsFrameSelection> frameselection = GetFrameSelection();