Bug 240933 - Part 10: Only hide/show the caret once when placeholder transactions finish; r=roc a=dbaron

--HG--
extra : rebase_source : 21823fb610b02859893f1461e8adaf38f5d61e94
This commit is contained in:
Ehsan Akhgari 2010-07-21 16:08:52 -04:00
Родитель 3defea6edd
Коммит 32c4ddec2f
1 изменённых файлов: 20 добавлений и 7 удалений

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

@ -904,14 +904,27 @@ nsEditor::EndPlaceHolderTransaction()
if (selPrivate) {
selPrivate->SetCanCacheFrameOffset(PR_TRUE);
}
// time to turn off the batch
EndUpdateViewBatch();
// make sure selection is in view
// After ScrollSelectionIntoView(), the pending notifications might be
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
ScrollSelectionIntoView(PR_FALSE);
{
// Hide the caret here to avoid hiding it twice, once in EndUpdateViewBatch
// and once in ScrollSelectionIntoView.
nsRefPtr<nsCaret> caret;
nsCOMPtr<nsIPresShell> presShell;
GetPresShell(getter_AddRefs(presShell));
if (presShell)
caret = presShell->GetCaret();
StCaretHider caretHider(caret);
// time to turn off the batch
EndUpdateViewBatch();
// make sure selection is in view
// After ScrollSelectionIntoView(), the pending notifications might be
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
ScrollSelectionIntoView(PR_FALSE);
}
// cached for frame offset are Not available now
if (selPrivate) {