This commit is contained in:
Cameron Kaiser 2017-09-01 21:37:44 -07:00
parent 693b6a16ea
commit 19a2166287
1 changed files with 6 additions and 16 deletions

View File

@ -953,23 +953,13 @@ nsEditor::EndPlaceHolderTransaction()
selection->SetCanCacheFrameOffset(true);
}
{
// Hide the caret here to avoid hiding it twice, once in EndUpdateViewBatch
// and once in ScrollSelectionIntoView.
RefPtr<nsCaret> caret;
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
// time to turn off the batch
EndUpdateViewBatch();
// make sure selection is in view
if (presShell)
caret = presShell->GetCaret();
// 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(false);
}
// After ScrollSelectionIntoView(), the pending notifications might be
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
ScrollSelectionIntoView(false);
// cached for frame offset are Not available now
if (selection) {