Bug 201797. Do an extra reflow of the scrollframe if we adjusted the width or height after reflowing it the first time. Also, don't include border/padding when calculating the visible width in the unconstrained case

This commit is contained in:
roc+%cs.cmu.edu 2003-05-04 19:00:21 +00:00
parent e27ab6d217
commit f4a1c61d8c
2 changed files with 4 additions and 10 deletions

View File

@ -1311,10 +1311,6 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext,
}
}
if (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth) {
visibleWidth += aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right;
}
// When in dropdown mode make sure we obey min/max-width and min/max-height
if (!isInDropDownMode) {
nscoord fullWidth = visibleWidth + aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right;
@ -1377,7 +1373,8 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext,
secondPassState.mComputedHeight = visibleHeight;
secondPassState.reason = eReflowReason_Resize;
if (mPassId == 0 || mPassId == 2) {
if (mPassId == 0 || mPassId == 2 || visibleHeight != scrolledAreaHeight ||
visibleWidth != scrolledAreaWidth) {
nsGfxScrollFrame::Reflow(aPresContext, aDesiredSize, secondPassState, aStatus);
if (aReflowState.mComputedHeight == 0) {
aDesiredSize.ascent = 0;

View File

@ -1311,10 +1311,6 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext,
}
}
if (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth) {
visibleWidth += aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right;
}
// When in dropdown mode make sure we obey min/max-width and min/max-height
if (!isInDropDownMode) {
nscoord fullWidth = visibleWidth + aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right;
@ -1377,7 +1373,8 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext,
secondPassState.mComputedHeight = visibleHeight;
secondPassState.reason = eReflowReason_Resize;
if (mPassId == 0 || mPassId == 2) {
if (mPassId == 0 || mPassId == 2 || visibleHeight != scrolledAreaHeight ||
visibleWidth != scrolledAreaWidth) {
nsGfxScrollFrame::Reflow(aPresContext, aDesiredSize, secondPassState, aStatus);
if (aReflowState.mComputedHeight == 0) {
aDesiredSize.ascent = 0;