r=kin,troy; Fixed reflow bug with optimization logic to avoid measuring text (no bug #)

This commit is contained in:
kipp%netscape.com 1999-10-12 23:29:01 +00:00
parent e44578adf4
commit 02b64f135d
2 changed files with 20 additions and 2 deletions

View File

@ -2548,10 +2548,19 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
(mState & TEXT_OPTIMIZE_RESIZE) &&
!aMetrics.maxElementSize &&
(lastTimeWeSkippedLeadingWS == skipWhitespace) &&
((wrapping && (maxWidth >= realWidth)) || (prevColumn == column))) {
((wrapping && (maxWidth >= realWidth)) ||
(!wrapping && (prevColumn == column)))) {
// We can skip measuring of text and use the value from our
// previous reflow
measureText = PR_FALSE;
#ifdef NOISY_REFLOW
printf(" => measureText=%s wrapping=%s skipWhitespace=%s",
measureText ? "yes" : "no",
wrapping ? "yes" : "no",
skipWhitespace ? "yes" : "no");
printf(" realWidth=%d maxWidth=%d\n",
realWidth, maxWidth);
#endif
}
}

View File

@ -2548,10 +2548,19 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
(mState & TEXT_OPTIMIZE_RESIZE) &&
!aMetrics.maxElementSize &&
(lastTimeWeSkippedLeadingWS == skipWhitespace) &&
((wrapping && (maxWidth >= realWidth)) || (prevColumn == column))) {
((wrapping && (maxWidth >= realWidth)) ||
(!wrapping && (prevColumn == column)))) {
// We can skip measuring of text and use the value from our
// previous reflow
measureText = PR_FALSE;
#ifdef NOISY_REFLOW
printf(" => measureText=%s wrapping=%s skipWhitespace=%s",
measureText ? "yes" : "no",
wrapping ? "yes" : "no",
skipWhitespace ? "yes" : "no");
printf(" realWidth=%d maxWidth=%d\n",
realWidth, maxWidth);
#endif
}
}