Scroll the find position last so that it is not overriden by another intermediate scrolling, b=242056, r=akkana, sr=jst

This commit is contained in:
rbs%maths.uq.edu.au 2004-05-01 07:47:23 +00:00
Родитель 152aab0aac
Коммит 487cf2d38c
1 изменённых файлов: 6 добавлений и 4 удалений

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

@ -452,10 +452,6 @@ void nsWebBrowserFind::SetSelectionAndScroll(nsIDOMWindow* aWindow,
if (selection) {
selection->RemoveAllRanges();
selection->AddRange(aRange);
// Scroll if necessary to make the selection visible:
selCon->ScrollSelectionIntoView
(nsISelectionController::SELECTION_NORMAL,
nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
if (tcFrame) {
FocusElementButNotDocument(doc, content);
@ -467,6 +463,12 @@ void nsWebBrowserFind::SetSelectionAndScroll(nsIDOMWindow* aWindow,
presContext->EventStateManager()->
MoveFocusToCaret(PR_TRUE, &isSelectionWithFocus);
}
// Scroll if necessary to make the selection visible:
// Must be the last thing to do - bug 242056
selCon->ScrollSelectionIntoView
(nsISelectionController::SELECTION_NORMAL,
nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
}
}