The patch in nsPageFrame.cpp is insurance to help keep a problem like this from

hanging the browser again.
The patch in nsSimplePageSequence.cpp is the actual fix. I verified that
nsPageFrame patch will stop it from happening.
Bug 132022 r=dcone a=attinasi a=scc
This commit is contained in:
rods%netscape.com 2002-03-20 12:34:18 +00:00
parent 5f0cdb2992
commit ebc1a45637
4 changed files with 30 additions and 4 deletions

View File

@ -199,6 +199,19 @@ NS_IMETHODIMP nsPageFrame::Reflow(nsIPresContext* aPresContext,
}
nsSize maxSize(mPD->mReflowRect.width - mPD->mReflowMargin.right - mPD->mReflowMargin.left,
avHeight);
// Get the number of Twips per pixel from the PresContext
float p2t;
aPresContext->GetScaledPixelsToTwips(&p2t);
nscoord onePixelInTwips = NSToCoordRound(p2t);
NS_ASSERTION(maxSize.width >= onePixelInTwips, "maxSize.width must be >= 1 pixel");
NS_ASSERTION(maxSize.height >= onePixelInTwips, "maxSize.height must be >= 1 pixel");
// insurance against infinite reflow, when reflowing less than a pixel
if (maxSize.width < onePixelInTwips || maxSize.height < onePixelInTwips) {
aDesiredSize.width = 0;
aDesiredSize.height = 0;
return NS_OK;
}
nsHTMLReflowState kidReflowState(aPresContext, aReflowState, frame, maxSize);
kidReflowState.mFlags.mIsTopOfPage = PR_TRUE;

View File

@ -346,8 +346,8 @@ nsSimplePageSequenceFrame::Reflow(nsIPresContext* aPresContext,
if (pageSize != adjSize &&
(adjSize.x != 0 || adjSize.y != 0 || adjSize.width != 0 || adjSize.height != 0)) {
suppressLeftMargin = pageSize.x != adjSize.x;
suppressTopMargin = pageSize.y != adjSize.y;
suppressLeftMargin = pageSize.x != adjSize.x || (pageSize.x == adjSize.x && !adjSize.x);
suppressTopMargin = pageSize.y != adjSize.y || (pageSize.y == adjSize.y && !adjSize.y);
if (pageSize.width != adjSize.width) {
suppressRightMargin = PR_TRUE;
pageSize.width = adjSize.width;

View File

@ -199,6 +199,19 @@ NS_IMETHODIMP nsPageFrame::Reflow(nsIPresContext* aPresContext,
}
nsSize maxSize(mPD->mReflowRect.width - mPD->mReflowMargin.right - mPD->mReflowMargin.left,
avHeight);
// Get the number of Twips per pixel from the PresContext
float p2t;
aPresContext->GetScaledPixelsToTwips(&p2t);
nscoord onePixelInTwips = NSToCoordRound(p2t);
NS_ASSERTION(maxSize.width >= onePixelInTwips, "maxSize.width must be >= 1 pixel");
NS_ASSERTION(maxSize.height >= onePixelInTwips, "maxSize.height must be >= 1 pixel");
// insurance against infinite reflow, when reflowing less than a pixel
if (maxSize.width < onePixelInTwips || maxSize.height < onePixelInTwips) {
aDesiredSize.width = 0;
aDesiredSize.height = 0;
return NS_OK;
}
nsHTMLReflowState kidReflowState(aPresContext, aReflowState, frame, maxSize);
kidReflowState.mFlags.mIsTopOfPage = PR_TRUE;

View File

@ -346,8 +346,8 @@ nsSimplePageSequenceFrame::Reflow(nsIPresContext* aPresContext,
if (pageSize != adjSize &&
(adjSize.x != 0 || adjSize.y != 0 || adjSize.width != 0 || adjSize.height != 0)) {
suppressLeftMargin = pageSize.x != adjSize.x;
suppressTopMargin = pageSize.y != adjSize.y;
suppressLeftMargin = pageSize.x != adjSize.x || (pageSize.x == adjSize.x && !adjSize.x);
suppressTopMargin = pageSize.y != adjSize.y || (pageSize.y == adjSize.y && !adjSize.y);
if (pageSize.width != adjSize.width) {
suppressRightMargin = PR_TRUE;
pageSize.width = adjSize.width;