From 3b68db91c5a9076f707507eb2e718aeb3af21d56 Mon Sep 17 00:00:00 2001 From: "Olli.Pettay%helsinki.fi" Date: Thu, 20 Dec 2007 23:49:46 +0000 Subject: [PATCH] Bug 392698, ASSERTION: can't mark frame dirty during reflow, r+sr=roc, a=blocking1.9 git-svn-id: svn://10.0.0.236/trunk@241872 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsGfxScrollFrame.cpp | 27 ++++++++++++--------- mozilla/layout/generic/nsGfxScrollFrame.h | 1 + 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/mozilla/layout/generic/nsGfxScrollFrame.cpp b/mozilla/layout/generic/nsGfxScrollFrame.cpp index eb63e55a6eb..1858d499b7e 100644 --- a/mozilla/layout/generic/nsGfxScrollFrame.cpp +++ b/mozilla/layout/generic/nsGfxScrollFrame.cpp @@ -1248,7 +1248,8 @@ nsGfxScrollFrameInner::nsGfxScrollFrameInner(nsContainerFrame* aOuter, mHadNonInitialReflow(PR_FALSE), mHorizontalOverflow(PR_FALSE), mVerticalOverflow(PR_FALSE), - mPostedReflowCallback(PR_FALSE) + mPostedReflowCallback(PR_FALSE), + mMayHaveDirtyFixedChildren(PR_FALSE) { } @@ -2350,6 +2351,19 @@ nsGfxScrollFrameInner::ReflowFinished() { mPostedReflowCallback = PR_FALSE; + if (mMayHaveDirtyFixedChildren) { + mMayHaveDirtyFixedChildren = PR_FALSE; + nsIFrame* parentFrame = mOuter->GetParent(); + for (nsIFrame* fixedChild = + parentFrame->GetFirstChild(nsGkAtoms::fixedList); + fixedChild; fixedChild = fixedChild->GetNextSibling()) { + // force a reflow of the fixed child + mOuter->PresContext()->PresShell()-> + FrameNeedsReflow(fixedChild, nsIPresShell::eResize, + NS_FRAME_HAS_DIRTY_CHILDREN); + } + } + // Update scrollbar attributes. nsPresContext* presContext = mOuter->PresContext(); @@ -2505,16 +2519,7 @@ nsGfxScrollFrameInner::LayoutScrollbars(nsBoxLayoutState& aState, if (aOldScrollArea.Size() != aScrollArea.Size() && !(mOuter->GetStateBits() & NS_FRAME_IS_DIRTY) && mIsRoot) { - nsIFrame* parentFrame = mOuter->GetParent(); - for (nsIFrame *fixedChild = - parentFrame->GetFirstChild(nsGkAtoms::fixedList); - fixedChild; fixedChild = fixedChild->GetNextSibling()) { - // force a reflow of the fixed child - // XXX Will this work given where we currently are in reflow? - aState.PresContext()->PresShell()-> - FrameNeedsReflow(fixedChild, nsIPresShell::eResize, - NS_FRAME_HAS_DIRTY_CHILDREN); - } + mMayHaveDirtyFixedChildren = PR_TRUE; } // post reflow callback to modify scrollbar attributes diff --git a/mozilla/layout/generic/nsGfxScrollFrame.h b/mozilla/layout/generic/nsGfxScrollFrame.h index 563285db9e7..9e56dba3f7c 100644 --- a/mozilla/layout/generic/nsGfxScrollFrame.h +++ b/mozilla/layout/generic/nsGfxScrollFrame.h @@ -230,6 +230,7 @@ public: PRPackedBool mHorizontalOverflow:1; PRPackedBool mVerticalOverflow:1; PRPackedBool mPostedReflowCallback:1; + PRPackedBool mMayHaveDirtyFixedChildren:1; }; /**