Bug 576435 - Use the clamping variant of NSToCoordRound to avoid rounding nscoord_MAX. r=roc
authorDavid Major <dmajor@mozilla.com>
Tue, 24 Jun 2014 15:47:02 +1200
changeset 190391 3c1828d5bfe58100f26553f43c7046c859570353
parent 190390 9e3ed7d843a82c4f76311a28f73a381d559b8dc9
child 190392 c18081e9d03228681bd0ac58031d073dee39a150
push id27004
push useremorley@mozilla.com
push dateTue, 24 Jun 2014 15:52:34 +0000
treeherdermozilla-central@7b174d47f3cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs576435
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 576435 - Use the clamping variant of NSToCoordRound to avoid rounding nscoord_MAX. r=roc
layout/style/crashtests/crashtests.list
layout/style/nsRuleNode.cpp
--- a/layout/style/crashtests/crashtests.list
+++ b/layout/style/crashtests/crashtests.list
@@ -14,17 +14,17 @@ load 383979-1.xhtml
 load 383979-2.html
 load 386939-1.html
 load 391034-1.xhtml
 load 397022-1.html
 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
 load 432561-1.html
 load 437170-1.html
 load 437532-1.html
 skip load 439184-1.html # skip until we figure out how to test this
 load 444237-1.html
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -2737,22 +2737,20 @@ ComputeScriptLevelSize(const nsStyleFont
     minScriptSize = nsStyleFont::ZoomText(aPresContext, minScriptSize);
   }
 
   double scriptLevelScale =
     pow(aParentFont->mScriptSizeMultiplier, scriptLevelChange);
   // 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
       // (authors are allowed to explicitly set the font size smaller than
       // minscriptsize)
       return aParentFont->mSize;
     }
     // We can decrease, so apply constraint #1