Bug 1153237 - nsFrameSelection::PhysicalMove should fall back to CompleteMove if an intra-line move fails to execute completely. r=roc

This commit is contained in:
Jonathan Kew 2016-01-04 12:33:45 +00:00
parent d161c88dbf
commit 57932d022e

View File

@ -2129,6 +2129,14 @@ nsFrameSelection::PhysicalMove(int16_t aDirection, int16_t aAmount,
rv = MoveCaret(mapping.direction, aExtend, mapping.amounts[aAmount + 1],
eVisual);
}
// And if it was an intra-line move that failed, just move to line-edge
// in the given direction.
else if (mapping.amounts[aAmount] < eSelectLine) {
nsCOMPtr<nsISelectionController> controller = do_QueryInterface(mShell);
if (controller) {
rv = controller->CompleteMove(mapping.direction == eDirNext, aExtend);
}
}
}
return rv;