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 321126 5eed1210b69a03c364741fa7b35107703e1114c2
parent 321125 1354f15ccab53581cd3d6ce25d625f2a8b09ff01
child 321127 253395be59f635d21a4204539233613d7c35c2b9
push id83532
push usermpalmgren@mozilla.com
push dateSat, 05 Nov 2016 01:57:23 +0000
treeherdermozilla-inbound@253395be59f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1314206
milestone52.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 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;