Bug 1174450 part 3 - Rename AddIntrinsicSizeOffset local vars from xISize to xSize since the code is generic and handles both ISizes and BSizes. r=jfkthame
authorMats Palmgren <mats@mozilla.com>
Tue, 16 Jun 2015 11:21:03 +0000
changeset 279876 0ab7b15d0f9e5a2a1bc6d3e7ab8117fb03a51d90
parent 279875 049abdaa341db79086dd9414d7a4e88f0830a7f5
child 279877 4caa417b34ee9118a6ee492b8e3138e712b5714a
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1174450
milestone41.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 1174450 part 3 - Rename AddIntrinsicSizeOffset local vars from xISize to xSize since the code is generic and handles both ISizes and BSizes. r=jfkthame
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -4335,57 +4335,57 @@ AddIntrinsicSizeOffset(nsRenderingContex
 {
   // We also need to track what has been added on outside of the box
   // (controlled by 'box-sizing') where 'width', 'min-width' and
   // 'max-width' are applied.  We have to account for these properties
   // after getting all the offsets (margin, border, padding) because
   // percentages do not operate linearly.
   // Doing this is ok because although percentages aren't handled
   // linearly, they are handled monotonically.
-  nscoord coordOutsideISize = 0;
-  float pctOutsideISize = 0;
+  nscoord coordOutsideSize = 0;
+  float pctOutsideSize = 0;
   float pctTotal = 0.0f;
 
   if (!(aFlags & nsLayoutUtils::IGNORE_PADDING)) {
-    coordOutsideISize += aOffsets.hPadding;
-    pctOutsideISize += aOffsets.hPctPadding;
+    coordOutsideSize += aOffsets.hPadding;
+    pctOutsideSize += aOffsets.hPctPadding;
 
     if (aBoxSizing == NS_STYLE_BOX_SIZING_PADDING) {
-      min += coordOutsideISize;
-      result = NSCoordSaturatingAdd(result, coordOutsideISize);
-      pctTotal += pctOutsideISize;
-
-      coordOutsideISize = 0;
-      pctOutsideISize = 0.0f;
-    }
-  }
-
-  coordOutsideISize += aOffsets.hBorder;
+      min += coordOutsideSize;
+      result = NSCoordSaturatingAdd(result, coordOutsideSize);
+      pctTotal += pctOutsideSize;
+
+      coordOutsideSize = 0;
+      pctOutsideSize = 0.0f;
+    }
+  }
+
+  coordOutsideSize += aOffsets.hBorder;
 
   if (aBoxSizing == NS_STYLE_BOX_SIZING_BORDER) {
-    min += coordOutsideISize;
-    result = NSCoordSaturatingAdd(result, coordOutsideISize);
-    pctTotal += pctOutsideISize;
-
-    coordOutsideISize = 0;
-    pctOutsideISize = 0.0f;
-  }
-
-  coordOutsideISize += aOffsets.hMargin;
-  pctOutsideISize += aOffsets.hPctMargin;
-
-  min += coordOutsideISize;
-  result = NSCoordSaturatingAdd(result, coordOutsideISize);
-  pctTotal += pctOutsideISize;
+    min += coordOutsideSize;
+    result = NSCoordSaturatingAdd(result, coordOutsideSize);
+    pctTotal += pctOutsideSize;
+
+    coordOutsideSize = 0;
+    pctOutsideSize = 0.0f;
+  }
+
+  coordOutsideSize += aOffsets.hMargin;
+  pctOutsideSize += aOffsets.hPctMargin;
+
+  min += coordOutsideSize;
+  result = NSCoordSaturatingAdd(result, coordOutsideSize);
+  pctTotal += pctOutsideSize;
 
   nscoord w;
   if (GetAbsoluteCoord(aStyleSize, w) ||
       GetIntrinsicCoord(aStyleSize, aRenderingContext, aFrame,
                         PROP_WIDTH, w)) {
-    result = AddPercents(aType, w + coordOutsideISize, pctOutsideISize);
+    result = AddPercents(aType, w + coordOutsideSize, pctOutsideSize);
   }
   else if (aType == nsLayoutUtils::MIN_ISIZE &&
            // The only cases of coord-percent-calc() units that
            // GetAbsoluteCoord didn't handle are percent and calc()s
            // containing percent.
            aStyleSize.IsCoordPercentCalcUnit() &&
            aFrame->IsFrameOfType(nsIFrame::eReplaced)) {
     // A percentage width on replaced elements means they can shrink to 0.
@@ -4395,72 +4395,72 @@ AddIntrinsicSizeOffset(nsRenderingContex
     // NOTE: We could really do a lot better for percents and for some
     // cases of calc() containing percent (certainly including any where
     // the coefficient on the percent is positive and there are no max()
     // expressions).  However, doing better for percents wouldn't be
     // backwards compatible.
     result = AddPercents(aType, result, pctTotal);
   }
 
-  nscoord maxISize;
-  bool haveFixedMaxISize = GetAbsoluteCoord(aStyleMaxSize, maxISize);
-  nscoord minISize;
+  nscoord maxSize;
+  bool haveFixedMaxSize = GetAbsoluteCoord(aStyleMaxSize, maxSize);
+  nscoord minSize;
 
   // Treat "min-width: auto" as 0.
-  bool haveFixedMinISize;
+  bool haveFixedMinSize;
   if (eStyleUnit_Auto == aStyleMinSize.GetUnit()) {
     // NOTE: Technically, "auto" is supposed to behave like "min-content" on
     // flex items. However, we don't need to worry about that here, because
     // flex items' min-sizes are intentionally ignored until the flex
     // container explicitly considers them during space distribution.
-    minISize = 0;
-    haveFixedMinISize = true;
+    minSize = 0;
+    haveFixedMinSize = true;
   } else {
-    haveFixedMinISize = GetAbsoluteCoord(aStyleMinSize, minISize);
-  }
-
-  if (haveFixedMaxISize ||
+    haveFixedMinSize = GetAbsoluteCoord(aStyleMinSize, minSize);
+  }
+
+  if (haveFixedMaxSize ||
       GetIntrinsicCoord(aStyleMaxSize, aRenderingContext, aFrame,
-                        PROP_MAX_WIDTH, maxISize)) {
-    maxISize = AddPercents(aType, maxISize + coordOutsideISize, pctOutsideISize);
-    if (result > maxISize)
-      result = maxISize;
-  }
-
-  if (haveFixedMinISize ||
+                        PROP_MAX_WIDTH, maxSize)) {
+    maxSize = AddPercents(aType, maxSize + coordOutsideSize, pctOutsideSize);
+    if (result > maxSize)
+      result = maxSize;
+  }
+
+  if (haveFixedMinSize ||
       GetIntrinsicCoord(aStyleMinSize, aRenderingContext, aFrame,
-                        PROP_MIN_WIDTH, minISize)) {
-    minISize = AddPercents(aType, minISize + coordOutsideISize, pctOutsideISize);
-    if (result < minISize)
-      result = minISize;
+                        PROP_MIN_WIDTH, minSize)) {
+    minSize = AddPercents(aType, minSize + coordOutsideSize, pctOutsideSize);
+    if (result < minSize)
+      result = minSize;
   }
 
   min = AddPercents(aType, min, pctTotal);
   if (result < min)
     result = min;
 
   const nsStyleDisplay *disp = aFrame->StyleDisplay();
   if (aFrame->IsThemed(disp)) {
     LayoutDeviceIntSize size;
     bool canOverride = true;
     nsPresContext *presContext = aFrame->PresContext();
     presContext->GetTheme()->
       GetMinimumWidgetSize(presContext, aFrame, disp->mAppearance,
                            &size, &canOverride);
 
-    nscoord themeISize =
+    nscoord themeSize =
       presContext->DevPixelsToAppUnits(aContainerWM.IsVertical() ? size.height
                                                                  : size.width);
 
     // GMWS() returns a border-box width
-    themeISize += aOffsets.hMargin;
-    themeISize = AddPercents(aType, themeISize, aOffsets.hPctMargin);
-
-    if (themeISize > result || !canOverride) {
-      result = themeISize;
+    themeSize += aOffsets.hMargin;
+    themeSize = AddPercents(aType, themeSize, aOffsets.hPctMargin);
+
+    if (themeSize > result || !canOverride) {
+      result = themeSize;
     }
   }
   return result;
 }
 
 /* static */ nscoord
 nsLayoutUtils::IntrinsicForContainer(nsRenderingContext *aRenderingContext,
                                      nsIFrame *aFrame,