Slight performance improvement

git-svn-id: svn://10.0.0.236/trunk@66855 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy%netscape.com 2000-04-22 15:50:12 +00:00
parent bfc3003957
commit ec619780c1
2 changed files with 32 additions and 6 deletions

View File

@ -449,10 +449,23 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame,
// width
reflowState.availableWidth = oldAvailableWidth;
reflowState.mComputedWidth = oldComputedWidth;
reason = eReflowReason_Resize;
// We don't need to do this second reflow if we're being reflowed
// with an unconstrained reflow
if (NS_UNCONSTRAINEDSIZE != reflowState.availableWidth) {
reason = eReflowReason_Resize;
// Don't bother having the frame compute its max-element-size again
nsSize* oldMaxElementSize = mMetrics.maxElementSize;
mMetrics.maxElementSize = nsnull;
rv = aFrame->Reflow(mPresContext, mMetrics, reflowState,
aFrameReflowStatus);
mMetrics.maxElementSize = oldMaxElementSize;
}
} else {
rv = aFrame->Reflow(mPresContext, mMetrics, reflowState,
aFrameReflowStatus);
}
rv = aFrame->Reflow(mPresContext, mMetrics, reflowState,
aFrameReflowStatus);
mOuterReflowState.mSpaceManager->Translate(-tx, -ty);
#ifdef DEBUG

View File

@ -449,10 +449,23 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame,
// width
reflowState.availableWidth = oldAvailableWidth;
reflowState.mComputedWidth = oldComputedWidth;
reason = eReflowReason_Resize;
// We don't need to do this second reflow if we're being reflowed
// with an unconstrained reflow
if (NS_UNCONSTRAINEDSIZE != reflowState.availableWidth) {
reason = eReflowReason_Resize;
// Don't bother having the frame compute its max-element-size again
nsSize* oldMaxElementSize = mMetrics.maxElementSize;
mMetrics.maxElementSize = nsnull;
rv = aFrame->Reflow(mPresContext, mMetrics, reflowState,
aFrameReflowStatus);
mMetrics.maxElementSize = oldMaxElementSize;
}
} else {
rv = aFrame->Reflow(mPresContext, mMetrics, reflowState,
aFrameReflowStatus);
}
rv = aFrame->Reflow(mPresContext, mMetrics, reflowState,
aFrameReflowStatus);
mOuterReflowState.mSpaceManager->Translate(-tx, -ty);
#ifdef DEBUG