Fix very bad reflow problem in nsBoxToBlockAdaptor (bug 119849). r=hewitt@netscape.com, sr=attinasi@netscape.com

This commit is contained in:
jkeiser%netscape.com 2002-04-12 04:39:48 +00:00
parent cc964d5bed
commit c09f9a2e00
2 changed files with 11 additions and 5 deletions

View File

@ -1020,7 +1020,7 @@ nsBoxFrame::Reflow(nsIPresContext* aPresContext,
aDesiredSize.width = r.width;
aDesiredSize.height = r.height;
aDesiredSize.ascent = ascent;
aDesiredSize.descent = 0;
aDesiredSize.descent = r.height - ascent;
// max sure the max element size reflects
// our min width

View File

@ -530,7 +530,7 @@ nsBoxToBlockAdaptor::GetMaxSize(nsBoxLayoutState& aState, nsSize& aSize)
} else {
mMaxSize.width = NS_INTRINSICSIZE;
mMaxSize.height = NS_INTRINSICSIZE;
nsresult rv = nsBox::GetMaxSize(aState, mMaxSize);
nsBox::GetMaxSize(aState, mMaxSize);
}
aSize = mMaxSize;
@ -593,7 +593,6 @@ nsBoxToBlockAdaptor::DoLayout(nsBoxLayoutState& aState)
const nsHTMLReflowState* reflowState = aState.GetReflowState();
nsIPresContext* presContext = aState.GetPresContext();
nsReflowStatus status = NS_FRAME_COMPLETE;
nsSize maxElementSize(0,0);
nsHTMLReflowMetrics desiredSize(nsnull);
nsresult rv;
@ -607,8 +606,6 @@ nsBoxToBlockAdaptor::DoLayout(nsBoxLayoutState& aState)
desiredSize.maxElementSize = &maxElementSize;
}
nscoord origWidth = ourRect.width;
rv = Reflow(aState,
presContext,
desiredSize,
@ -835,6 +832,15 @@ nsBoxToBlockAdaptor::Reflow(nsBoxLayoutState& aState,
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
// Save the ascent. (bug 103925)
PRBool isCollapsed = PR_FALSE;
IsCollapsed(aState, isCollapsed);
if (isCollapsed) {
mAscent = 0;
} else {
mAscent = aDesiredSize.ascent;
}
nsFrameState kidState;
mFrame->GetFrameState(&kidState);