Make sure layout is up to date before moving the caret. Bug 375436 followup to fix orange, pending reviews from roc.

This commit is contained in:
bzbarsky@mit.edu 2007-08-21 22:13:24 -07:00
Родитель 15482c0a36
Коммит 733ec5dc31
1 изменённых файлов: 14 добавлений и 0 удалений

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

@ -1222,6 +1222,20 @@ nsFrameSelection::MoveCaret(PRUint32 aKeycode,
PRBool aContinueSelection,
nsSelectionAmount aAmount)
{
{
// Make sure that if our presshell gets Destroy() called when we
// flush we don't die.
nsRefPtr<nsFrameSelection> kungFuDeathGrip(this);
// Flush out layout, since we need it to be up to date to do caret
// positioning.
mShell->FlushPendingNotifications(Flush_Layout);
if (!mShell) {
return NS_OK;
}
}
nsPresContext *context = mShell->GetPresContext();
if (!context)
return NS_ERROR_FAILURE;