From 0d9dd77e6699428e21f8707a84269949c66c5287 Mon Sep 17 00:00:00 2001 From: Jeremy Chen Date: Tue, 24 Mar 2015 03:34:00 -0400 Subject: [PATCH] Bug 1140625 - Part 5: Move Flush_Layout to the right place in SelectionCarets::UpdateSelectionCarets. r=roc --- layout/base/SelectionCarets.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout/base/SelectionCarets.cpp b/layout/base/SelectionCarets.cpp index f59928fc9a8d..242af5edb496 100644 --- a/layout/base/SelectionCarets.cpp +++ b/layout/base/SelectionCarets.cpp @@ -462,6 +462,8 @@ SelectionCarets::UpdateSelectionCarets() nsRefPtr firstRange = selection->GetRangeAt(0); nsRefPtr lastRange = selection->GetRangeAt(rangeCount - 1); + mPresShell->FlushPendingNotifications(Flush_Layout); + nsIFrame* rootFrame = mPresShell->GetRootFrame(); if (!rootFrame) { @@ -495,8 +497,6 @@ SelectionCarets::UpdateSelectionCarets() return; } - mPresShell->FlushPendingNotifications(Flush_Layout); - // If the selection is not visible, we should dispatch a event. nsIFrame* commonAncestorFrame = nsLayoutUtils::FindNearestCommonAncestorFrame(startFrame, endFrame);