Flush _before_ getting the presshell, not after. Bug 297079, r+sr=roc

This commit is contained in:
bzbarsky%mit.edu 2005-08-24 01:27:02 +00:00
Родитель 044618e198
Коммит aca7360746
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -183,13 +183,14 @@ nsBoxObject::GetOffsetRect(nsRect& aRect)
nsCOMPtr<nsIDocument> doc = mContent->GetDocument();
if (doc) {
// Flush all pending notifications so that our frames are uptodate. Must
// do this before we get the presshell, since this can destroy presshells.
doc->FlushPendingNotifications(Flush_Layout);
// Get Presentation shell 0
nsIPresShell *presShell = doc->GetShellAt(0);
if(presShell) {
// Flush all pending notifications so that our frames are uptodate
doc->FlushPendingNotifications(Flush_Layout);
// Get the Frame for our content
nsIFrame* frame = presShell->GetPrimaryFrameFor(mContent);
if(frame) {