Bug 1151214 part 1 - Remove the optimization to ignore 'align-content' changes for single-line flex containers. It's invalid now that we'll support 'align-content' for other box types (grid). r=dbaron
authorMats Palmgren <mats@mozilla.com>
Thu, 10 Sep 2015 21:07:26 +0200
changeset 294451 3a08426c6483533f850e8deda7c2504dad403ac6
parent 294450 0efead085a3b3212755cd398a8f77f5847bd1efd
child 294452 2c0cdff94db8e8e51eabd993e8d864d84c83117b
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1151214, 1176782
milestone43.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 1151214 part 1 - Remove the optimization to ignore 'align-content' changes for single-line flex containers. It's invalid now that we'll support 'align-content' for other box types (grid). r=dbaron Note that this also fixes a subtle bug: we *should* have returned nsChangeHint_NeutralChange from CalcDifference when we ignored the 'align-content' change (not zero). See bug 1176782 comment 14 (and the comments leading up to that) for details.
layout/style/nsStyleStruct.cpp
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -1579,26 +1579,19 @@ nsStylePosition::CalcDifference(const ns
   }
 
   // Changing justify-content on a flexbox might affect the positioning of its
   // children, but it won't affect any sizing.
   if (mJustifyContent != aOther.mJustifyContent) {
     NS_UpdateHint(hint, nsChangeHint_NeedReflow);
   }
 
-  // Properties that apply only to multi-line flex containers:
-  // 'align-content' can change the positioning & sizing of a multi-line flex
-  // container's children when there's extra space in the cross axis, but it
-  // shouldn't affect the container's own sizing.
-  //
-  // NOTE: If we get here, we know that mFlexWrap == aOther.mFlexWrap
-  // (otherwise, we would've returned earlier). So it doesn't matter which one
-  // of those we check to see if we're multi-line.
-  if (mFlexWrap != NS_STYLE_FLEX_WRAP_NOWRAP &&
-      mAlignContent != aOther.mAlignContent) {
+  // 'align-content' doesn't apply to a single-line flexbox but we don't know
+  // if we're a flex container at this point so we can't optimize for that.
+  if (mAlignContent != aOther.mAlignContent) {
     NS_UpdateHint(hint, nsChangeHint_NeedReflow);
   }
 
   bool widthChanged = mWidth != aOther.mWidth ||
                       mMinWidth != aOther.mMinWidth ||
                       mMaxWidth != aOther.mMaxWidth;
   bool heightChanged = mHeight != aOther.mHeight ||
                        mMinHeight != aOther.mMinHeight ||