Bug 392698, ASSERTION: can't mark frame dirty during reflow, r+sr=roc, a=blocking1.9

This commit is contained in:
Olli.Pettay@helsinki.fi 2007-12-20 15:49:46 -08:00
parent deaae4d9bd
commit 935f2d6de0
2 changed files with 17 additions and 11 deletions

View File

@ -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

View File

@ -230,6 +230,7 @@ public:
PRPackedBool mHorizontalOverflow:1;
PRPackedBool mVerticalOverflow:1;
PRPackedBool mPostedReflowCallback:1;
PRPackedBool mMayHaveDirtyFixedChildren:1;
};
/**