Bug 1314206 part 2 - [css-grid] Don't check for unconstrained inline size since it never occurs (other than by accident). r=dholbert
authorMats Palmgren <mats@mozilla.com>
Sat, 05 Nov 2016 02:57:08 +0100
changeset 351313 5eed1210b69a03c364741fa7b35107703e1114c2
parent 351312 1354f15ccab53581cd3d6ce25d625f2a8b09ff01
child 351314 253395be59f635d21a4204539233613d7c35c2b9
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1314206
milestone52.0a1
Bug 1314206 part 2 - [css-grid] Don't check for unconstrained inline size since it never occurs (other than by accident). r=dholbert
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -4757,29 +4757,26 @@ nsFrame::ComputeSize(nsRenderingContext*
                         minISizeCoord, aFlags);
   } else if (MOZ_UNLIKELY(isGridItem)) {
     // This implements "Implied Minimum Size of Grid Items".
     // https://drafts.csswg.org/css-grid/#min-size-auto
     minISize = std::min(maxISize, GetMinISize(aRenderingContext));
     if (inlineStyleCoord->IsCoordPercentCalcUnit()) {
       minISize = std::min(minISize, result.ISize(aWM));
     } else if (aFlags & eIClampMarginBoxMinSize) {
-      auto cbSize = aCBSize.ISize(aWM);
-      if (cbSize != NS_UNCONSTRAINEDSIZE) {
-        // "if the grid item spans only grid tracks that have a fixed max track
-        // sizing function, its automatic minimum size in that dimension is
-        // further clamped to less than or equal to the size necessary to fit
-        // its margin box within the resulting grid area (flooring at zero)"
-        // https://drafts.csswg.org/css-grid/#min-size-auto
-        auto maxMinISize = std::max(nscoord(0), cbSize -
-                                                aPadding.ISize(aWM) -
-                                                aBorder.ISize(aWM) -
-                                                aMargin.ISize(aWM));
-        minISize = std::min(minISize, maxMinISize);
-      }
+      // "if the grid item spans only grid tracks that have a fixed max track
+      // sizing function, its automatic minimum size in that dimension is
+      // further clamped to less than or equal to the size necessary to fit
+      // its margin box within the resulting grid area (flooring at zero)"
+      // https://drafts.csswg.org/css-grid/#min-size-auto
+      auto maxMinISize = std::max(nscoord(0), aCBSize.ISize(aWM) -
+                                              aPadding.ISize(aWM) -
+                                              aBorder.ISize(aWM) -
+                                              aMargin.ISize(aWM));
+      minISize = std::min(minISize, maxMinISize);
     }
   } else {
     // Treat "min-width: auto" as 0.
     // 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;