Bug 265857. Make sure we never split blocks when height is unconstrained, even if integer overflow in y-coord calculations makes it look like we're out of space. r+sr=bzbarsky

This commit is contained in:
roc+%cs.cmu.edu 2005-01-25 22:20:35 +00:00
Родитель 542cbca4c3
Коммит 08b67cc94d
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -700,9 +700,14 @@ nsBlockReflowContext::PlaceBlock(const nsHTMLReflowState& aReflowState,
aCombinedRect.y += y;
}
else {
// See if the frame fit. If its the first frame then it always
// fits.
if (aForceFit || (y + mMetrics.height <= mSpace.YMost()))
// See if the frame fit. If it's the first frame then it always
// fits. If the height is unconstrained then it always fits, even
// if there's some sort of integer overflow that makes
// y + mMetrics.height appear to go beyond the available height.
// XXX This is a bit of a hack. We really need to use floats in layout!
if (aForceFit ||
mSpace.height == NS_UNCONSTRAINEDSIZE ||
y + mMetrics.height <= mSpace.YMost())
{
// Calculate the actual x-offset and left and right margin
nsBlockHorizontalAlign align;