Bug 398181: Use NSCoordSaturatingAdd/Subtract in 3 places where we might have unconstrained heights. r+sr+a=roc

This commit is contained in:
dholbert@cs.stanford.edu 2007-11-09 09:16:36 -08:00
Родитель 61dc67815b
Коммит e1c9f57e6d
2 изменённых файлов: 3 добавлений и 3 удалений

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

@ -2866,12 +2866,12 @@ nsIFrame::InlinePrefWidthData::ForceBreak(nsIRenderingContext *aRenderingContext
if (floats_cur > floats_done)
floats_done = floats_cur;
currentLine += floats_done;
currentLine = NSCoordSaturatingAdd(currentLine, floats_done);
floats.Clear();
}
currentLine -= trailingWhitespace;
currentLine = NSCoordSaturatingSubtract(currentLine, trailingWhitespace, nscoord_MAX);
prevLines = PR_MAX(prevLines, currentLine);
currentLine = trailingWhitespace = 0;
}

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

@ -4933,7 +4933,7 @@ nsTextFrame::AddInlinePrefWidthForFlow(nsIRenderingContext *aRenderingContext,
// onto one line, so just measure it
nscoord width =
NSToCoordCeil(mTextRun->GetAdvanceWidth(start, flowEndInTextRun - start, &provider));
aData->currentLine += width;
aData->currentLine = NSCoordSaturatingAdd(aData->currentLine, width);
PRUint32 trimStart = GetEndOfTrimmedText(provider.GetFragment(), start,
flowEndInTextRun, &iter);