diff --git a/editor/libeditor/nsEditor.cpp b/editor/libeditor/nsEditor.cpp index 4656d1496..a72632a8d 100644 --- a/editor/libeditor/nsEditor.cpp +++ b/editor/libeditor/nsEditor.cpp @@ -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 caret; - nsCOMPtr 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) {