From 19a216628721e23cc059b8dc1bbc523b82fe203d Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Fri, 1 Sep 2017 21:37:44 -0700 Subject: [PATCH] #435: M1395157 --- editor/libeditor/nsEditor.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) 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) {