bug 124041 - prevent infinite splitting of images due to 0 avail height. sr=attinasi, r=alexsavulov, a=asa

git-svn-id: svn://10.0.0.236/trunk@115309 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
karnaze%netscape.com
2002-02-25 14:42:12 +00:00
parent 819c9ffa7a
commit a1c3edffaf
6 changed files with 37 additions and 2 deletions

View File

@@ -921,7 +921,10 @@ nsImageFrame::Reflow(nsIPresContext* aPresContext,
GetFrameType(getter_AddRefs(fType));
// split an image frame but not an image control frame
if (nsLayoutAtoms::imageFrame == fType.get()) {
aMetrics.height = aReflowState.availableHeight;
float p2t;
aPresContext->GetScaledPixelsToTwips(&p2t);
// our desired height was greater than 0, so to avoid infinite splitting, use 1 pixel as the min
aMetrics.height = PR_MAX(NSToCoordRound(p2t), aReflowState.availableHeight);
aStatus = NS_FRAME_NOT_COMPLETE;
}
}