improve MEW computation for scrollframes during incr. reflow bug=234593 r/sr=dbaron

This commit is contained in:
bmlk%gmx.de 2004-10-29 17:36:58 +00:00
Родитель 0422c5d7a6
Коммит 61235e1246
2 изменённых файлов: 44 добавлений и 20 удалений

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

@ -510,15 +510,21 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
nsresult rv = nsBoxFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
// if it was set then cache it. Otherwise set it.
if (aDesiredSize.mComputeMEW)
{
nsStyleUnit widthUnit = GetStylePosition()->mWidth.GetUnit();
if (widthUnit == eStyleUnit_Percent || widthUnit == eStyleUnit_Auto) {
nsMargin border = aReflowState.mComputedBorderPadding;
aDesiredSize.mMaxElementWidth = border.right + border.left;
mInner.mMaxElementWidth = aDesiredSize.mMaxElementWidth;
} else {
// if not set then use the cached size. If set then set it.
if (aDesiredSize.mMaxElementWidth == -1)
aDesiredSize.mMaxElementWidth = mInner.mMaxElementWidth;
else
mInner.mMaxElementWidth = aDesiredSize.mMaxElementWidth;
}
}
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
return rv;
@ -1032,15 +1038,21 @@ nsXULScrollFrame::Reflow(nsPresContext* aPresContext,
nsresult rv = nsBoxFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
// if it was set then cache it. Otherwise set it.
if (aDesiredSize.mComputeMEW)
{
nsStyleUnit widthUnit = GetStylePosition()->mWidth.GetUnit();
if (widthUnit == eStyleUnit_Percent || widthUnit == eStyleUnit_Auto) {
nsMargin border = aReflowState.mComputedBorderPadding;
aDesiredSize.mMaxElementWidth = border.right + border.left;
mInner.mMaxElementWidth = aDesiredSize.mMaxElementWidth;
} else {
// if not set then use the cached size. If set then set it.
if (aDesiredSize.mMaxElementWidth == -1)
aDesiredSize.mMaxElementWidth = mInner.mMaxElementWidth;
else
mInner.mMaxElementWidth = aDesiredSize.mMaxElementWidth;
}
}
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
return rv;

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

@ -510,15 +510,21 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
nsresult rv = nsBoxFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
// if it was set then cache it. Otherwise set it.
if (aDesiredSize.mComputeMEW)
{
nsStyleUnit widthUnit = GetStylePosition()->mWidth.GetUnit();
if (widthUnit == eStyleUnit_Percent || widthUnit == eStyleUnit_Auto) {
nsMargin border = aReflowState.mComputedBorderPadding;
aDesiredSize.mMaxElementWidth = border.right + border.left;
mInner.mMaxElementWidth = aDesiredSize.mMaxElementWidth;
} else {
// if not set then use the cached size. If set then set it.
if (aDesiredSize.mMaxElementWidth == -1)
aDesiredSize.mMaxElementWidth = mInner.mMaxElementWidth;
else
mInner.mMaxElementWidth = aDesiredSize.mMaxElementWidth;
}
}
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
return rv;
@ -1032,15 +1038,21 @@ nsXULScrollFrame::Reflow(nsPresContext* aPresContext,
nsresult rv = nsBoxFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
// if it was set then cache it. Otherwise set it.
if (aDesiredSize.mComputeMEW)
{
nsStyleUnit widthUnit = GetStylePosition()->mWidth.GetUnit();
if (widthUnit == eStyleUnit_Percent || widthUnit == eStyleUnit_Auto) {
nsMargin border = aReflowState.mComputedBorderPadding;
aDesiredSize.mMaxElementWidth = border.right + border.left;
mInner.mMaxElementWidth = aDesiredSize.mMaxElementWidth;
} else {
// if not set then use the cached size. If set then set it.
if (aDesiredSize.mMaxElementWidth == -1)
aDesiredSize.mMaxElementWidth = mInner.mMaxElementWidth;
else
mInner.mMaxElementWidth = aDesiredSize.mMaxElementWidth;
}
}
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
return rv;