mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
improve MEW computation for scrollframes during incr. reflow bug=234593 r/sr=dbaron
This commit is contained in:
parent
22a3945caa
commit
f57d797e4b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user