Bug 1255393 part 7 - [css-grid] Update intrinsic max track sizing for span>1 to the latest Grid spec. r=dholbert
authorMats Palmgren <mats@mozilla.com>
Tue, 27 Sep 2016 17:05:41 +0200
changeset 315474 2b923d48ea7e7cdc9ef648a79e957c99d81aadd5
parent 315473 9821b801c9901b19a8e96d28589f864ae4ab4d95
child 315475 4785d16bb24d1fbadd346253268d028893f2a95e
push id32628
push usercbook@mozilla.com
push dateWed, 28 Sep 2016 14:56:02 +0000
treeherderautoland@3a5db9f20b43 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1255393
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 1255393 part 7 - [css-grid] Update intrinsic max track sizing for span>1 to the latest Grid spec. r=dholbert Step 2.5 "For intrinsic maximums" now use the min-size contribution. https://hg.csswg.org/drafts/diff/575fb847e29d/css-grid/Overview.bs https://drafts.csswg.org/css-grid/#algo-content
layout/generic/nsGridContainerFrame.cpp
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -4174,22 +4174,22 @@ nsGridContainerFrame::Tracks::ResolveInt
           stateBitsPerSpan.SetCapacity(len);
           for (uint32_t i = stateBitsPerSpan.Length(); i < len; ++i) {
             stateBitsPerSpan.AppendElement(TrackSize::StateBits(0));
           }
         }
         stateBitsPerSpan[span] |= state;
         CachedIntrinsicSizes cache;
         nscoord minSize = 0;
-        if (state & TrackSize::eIntrinsicMinSizing) { // for 2.1
+        if (state & (TrackSize::eIntrinsicMinSizing |   // for 2.1
+                     TrackSize::eIntrinsicMaxSizing)) { // for 2.5
           minSize = MinSize(gridItem, aState, rc, wm, mAxis, &cache);
         }
         nscoord minContent = 0;
-        if (state & (contentBasedMinSelector |          // for 2.2
-                     TrackSize::eIntrinsicMaxSizing)) { // for 2.5
+        if (state & contentBasedMinSelector) { // for 2.2
           minContent = MinContentContribution(gridItem, aState,
                                               rc, wm, mAxis, &cache);
         }
         nscoord maxContent = 0;
         if (state & (maxContentMinSelector |                   // for 2.3
                      TrackSize::eAutoOrMaxContentMaxSizing)) { // for 2.6
           maxContent = MaxContentContribution(gridItem, aState,
                                               rc, wm, mAxis, &cache);
@@ -4306,23 +4306,23 @@ nsGridContainerFrame::Tracks::ResolveInt
         for (TrackSize& sz : plan) {
           if (sz.mLimit == NS_UNCONSTRAINEDSIZE) {
             // use mBase as the planned limit
           } else {
             sz.mBase = sz.mLimit;
           }
         }
 
-        // Step 2.5 MinContentContribution to intrinsic max-sizing.
+        // Step 2.5 MinSize to intrinsic max-sizing.
         for (i = spanGroupStartIndex; i < spanGroupEndIndex; ++i) {
           Step2ItemData& item = step2Items[i];
           if (!(item.mState & TrackSize::eIntrinsicMaxSizing)) {
             continue;
           }
-          nscoord space = item.mMinContentContribution;
+          nscoord space = item.mMinSize;
           if (space <= 0) {
             continue;
           }
           tracks.ClearAndRetainStorage();
           space = CollectGrowable(space, plan, item.mLineRange,
                                   TrackSize::eIntrinsicMaxSizing,
                                   tracks);
           if (space > 0) {