Bug 1424436 Part 1: Add more asserts in flex api calculation of mainDeltaSize values. r=dholbert
authorBrad Werth <bwerth@mozilla.com>
Fri, 08 Dec 2017 15:49:56 -0800
changeset 396252 12c2e518c50d42afc5357f9dd0aed9ef181c543e
parent 396251 c7398a75d48d6699b84a0d612cba9d829bc2c7a3
child 396253 a5c733e0b6d18d8516b3711fe3060a212d4c8787
push id56958
push userbwerth@mozilla.com
push dateWed, 13 Dec 2017 22:46:17 +0000
treeherderautoland@12c2e518c50d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1424436
milestone59.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 1424436 Part 1: Add more asserts in flex api calculation of mainDeltaSize values. r=dholbert MozReview-Commit-ID: IpMrMfmMy7t
layout/generic/nsFlexContainerFrame.cpp
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -2679,21 +2679,25 @@ FlexLine::ResolveFlexibleLengths(nscoord
             nscoord deltaSize = item->GetMainSize() -
               aLineInfo->mItems[itemIndex].mMainBaseSize;
 
             aLineInfo->mItems[itemIndex].mMainDeltaSize = deltaSize;
             // If any item on the line is growing, mark the aLineInfo
             // structure; likewise if any item is shrinking. Items in
             // a line can't be both growing and shrinking.
             if (deltaSize > 0) {
+              MOZ_ASSERT(item->IsFrozen() || isUsingFlexGrow,
+                "Unfrozen items shouldn't grow without isUsingFlexGrow.");
               MOZ_ASSERT(aLineInfo->mGrowthState !=
                          ComputedFlexLineInfo::GrowthState::SHRINKING);
               aLineInfo->mGrowthState =
                 ComputedFlexLineInfo::GrowthState::GROWING;
             } else if (deltaSize < 0) {
+              MOZ_ASSERT(item->IsFrozen() || !isUsingFlexGrow,
+               "Unfrozen items shouldn't shrink with isUsingFlexGrow.");
               MOZ_ASSERT(aLineInfo->mGrowthState !=
                          ComputedFlexLineInfo::GrowthState::GROWING);
               aLineInfo->mGrowthState =
                 ComputedFlexLineInfo::GrowthState::SHRINKING;
             }
           }
         }
       }