mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 10:43:24 +00:00
Bug 398181: Use NSCoordSaturatingAdd/Subtract in 3 places where we might have unconstrained heights. r+sr+a=roc
This commit is contained in:
parent
61dc67815b
commit
e1c9f57e6d
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user