зеркало из https://github.com/mozilla/pjs.git
improve MEW computation for scrollframes during incr. reflow bug=234593 r/sr=dbaron
This commit is contained in:
Родитель
0422c5d7a6
Коммит
61235e1246
|
@ -510,14 +510,20 @@ 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)
|
||||
{
|
||||
// if not set then use the cached size. If set then set it.
|
||||
if (aDesiredSize.mMaxElementWidth == -1)
|
||||
aDesiredSize.mMaxElementWidth = mInner.mMaxElementWidth;
|
||||
else
|
||||
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);
|
||||
|
@ -1032,14 +1038,20 @@ 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)
|
||||
{
|
||||
// if not set then use the cached size. If set then set it.
|
||||
if (aDesiredSize.mMaxElementWidth == -1)
|
||||
aDesiredSize.mMaxElementWidth = mInner.mMaxElementWidth;
|
||||
else
|
||||
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);
|
||||
|
|
|
@ -510,14 +510,20 @@ 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)
|
||||
{
|
||||
// if not set then use the cached size. If set then set it.
|
||||
if (aDesiredSize.mMaxElementWidth == -1)
|
||||
aDesiredSize.mMaxElementWidth = mInner.mMaxElementWidth;
|
||||
else
|
||||
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);
|
||||
|
@ -1032,14 +1038,20 @@ 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)
|
||||
{
|
||||
// if not set then use the cached size. If set then set it.
|
||||
if (aDesiredSize.mMaxElementWidth == -1)
|
||||
aDesiredSize.mMaxElementWidth = mInner.mMaxElementWidth;
|
||||
else
|
||||
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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче