Bug 576435 - Use the clamping variant of NSToCoordRound to avoid rounding nscoord_MAX. r=roc

This commit is contained in:
David Major 2014-06-24 15:47:02 +12:00
parent 4798898a62
commit e390b7e97c
2 changed files with 3 additions and 5 deletions

View File

@ -19,7 +19,7 @@ load 399289-1.svg
load 404470-1.html
load 411603-1.html
load 412588-1.html
asserts-if(winWidget,2) load 413274-1.xhtml # Bug 576435
load 413274-1.xhtml
load 416461-1.xul
load 418007-1.xhtml
load 431705-1.xul

View File

@ -2742,12 +2742,10 @@ ComputeScriptLevelSize(const nsStyleFont* aFont, const nsStyleFont* aParentFont,
// Compute the size we would have had if minscriptsize had never been
// applied, also prevent overflow (bug 413274)
*aUnconstrainedSize =
NSToCoordRound(std::min(aParentFont->mScriptUnconstrainedSize*scriptLevelScale,
double(nscoord_MAX)));
NSToCoordRoundWithClamp(aParentFont->mScriptUnconstrainedSize*scriptLevelScale);
// Compute the size we could get via scriptlevel change
nscoord scriptLevelSize =
NSToCoordRound(std::min(aParentFont->mSize*scriptLevelScale,
double(nscoord_MAX)));
NSToCoordRoundWithClamp(aParentFont->mSize*scriptLevelScale);
if (scriptLevelScale <= 1.0) {
if (aParentFont->mSize <= minScriptSize) {
// We can't decrease the font size at all, so just stick to no change