From 71eb57448201def10db4f05ed2be76b4551738eb Mon Sep 17 00:00:00 2001 From: "rbs%maths.uq.edu.au" Date: Sat, 30 Jul 2005 02:43:17 +0000 Subject: [PATCH] Avoing crashing due to outdated text pointers by flushing pending reflows before finding out where to scroll the selection, b=252970, r+sr=bzbarsky, a=bsmedberg git-svn-id: svn://10.0.0.236/trunk@176866 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsSelection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mozilla/layout/generic/nsSelection.cpp b/mozilla/layout/generic/nsSelection.cpp index 95f7126f8cd..24eecce9c54 100644 --- a/mozilla/layout/generic/nsSelection.cpp +++ b/mozilla/layout/generic/nsSelection.cpp @@ -7209,6 +7209,12 @@ nsTypedSelection::ScrollIntoView(SelectionRegion aRegion, PRBool aIsSynchronous) { StCaretHider caretHider(caret); // stack-based class hides and shows the caret + // We are going to scroll to a character offset within a frame by + // using APIs on the scrollable view directly. So we need to + // flush out pending reflows to make sure that frames are up-to-date. + // We crash otherwise - bug 252970#c97 + presShell->FlushPendingNotifications(Flush_OnlyReflow); + // // Scroll the selection region into view. //