зеркало из https://github.com/mozilla/gecko-dev.git
Bug 398181: Use NSCoordSaturatingAdd/Subtract in 3 places where we might have unconstrained heights. r+sr+a=roc
This commit is contained in:
Родитель
61dc67815b
Коммит
e1c9f57e6d
|
@ -2866,12 +2866,12 @@ nsIFrame::InlinePrefWidthData::ForceBreak(nsIRenderingContext *aRenderingContext
|
||||||
if (floats_cur > floats_done)
|
if (floats_cur > floats_done)
|
||||||
floats_done = floats_cur;
|
floats_done = floats_cur;
|
||||||
|
|
||||||
currentLine += floats_done;
|
currentLine = NSCoordSaturatingAdd(currentLine, floats_done);
|
||||||
|
|
||||||
floats.Clear();
|
floats.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
currentLine -= trailingWhitespace;
|
currentLine = NSCoordSaturatingSubtract(currentLine, trailingWhitespace, nscoord_MAX);
|
||||||
prevLines = PR_MAX(prevLines, currentLine);
|
prevLines = PR_MAX(prevLines, currentLine);
|
||||||
currentLine = trailingWhitespace = 0;
|
currentLine = trailingWhitespace = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4933,7 +4933,7 @@ nsTextFrame::AddInlinePrefWidthForFlow(nsIRenderingContext *aRenderingContext,
|
||||||
// onto one line, so just measure it
|
// onto one line, so just measure it
|
||||||
nscoord width =
|
nscoord width =
|
||||||
NSToCoordCeil(mTextRun->GetAdvanceWidth(start, flowEndInTextRun - start, &provider));
|
NSToCoordCeil(mTextRun->GetAdvanceWidth(start, flowEndInTextRun - start, &provider));
|
||||||
aData->currentLine += width;
|
aData->currentLine = NSCoordSaturatingAdd(aData->currentLine, width);
|
||||||
|
|
||||||
PRUint32 trimStart = GetEndOfTrimmedText(provider.GetFragment(), start,
|
PRUint32 trimStart = GetEndOfTrimmedText(provider.GetFragment(), start,
|
||||||
flowEndInTextRun, &iter);
|
flowEndInTextRun, &iter);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче