Bug 1591925 - When resolving min-size:auto on the main axis of flex items, treat `overflow:-moz-hidden-unscrollable` the same as `overflow:visible`. r=dholbert
☠☠ backed out by 771c82ef46a3 ☠ ☠
authoralaskanemily <emcdonough@mozilla.com>
Wed, 13 Nov 2019 23:57:39 +0000
changeset 501859 bbeb8f3081930de9728f5c0f1653dc467f7eac23
parent 501858 17f51f671e5f4c239f996047bebd0f8e59ebbda5
child 501860 b2d168294899bb4700cb3bd929c0bde85879fcea
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1591925
milestone72.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 1591925 - When resolving min-size:auto on the main axis of flex items, treat `overflow:-moz-hidden-unscrollable` the same as `overflow:visible`. r=dholbert Differential Revision: https://phabricator.services.mozilla.com/D52401
layout/generic/nsFlexContainerFrame.cpp
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -2088,28 +2088,29 @@ void FlexItem::CheckForMinSizeAuto(const
                                    const FlexboxAxisTracker& aAxisTracker) {
   const nsStylePosition* pos = aFlexItemReflowInput.mStylePosition;
   const nsStyleDisplay* disp = aFlexItemReflowInput.mStyleDisplay;
 
   // We'll need special behavior for "min-[width|height]:auto" (whichever is in
   // the flex container's main axis) iff:
   // (a) its computed value is "auto"
   // (b) the "overflow" sub-property in the same axis (the main axis) has a
-  //     computed value of "visible"
+  //     computed value of "visible" and the item does not create a scroll
+  //     container.
   const auto& mainMinSize = aAxisTracker.IsRowOriented()
                                 ? pos->MinISize(aAxisTracker.GetWritingMode())
                                 : pos->MinBSize(aAxisTracker.GetWritingMode());
 
-  // NOTE: Technically we should be checking the 'overflow' subproperty in the
-  // main axis. But since we only care whether it's 'visible', we can check
-  // either subproperty -- because they must be BOTH 'visible' or BOTH
-  // non-'visible' due to the way the subproperties interact.
+  // If the scrollable overflow makes us create a scroll container, then we
+  // don't need to do any extra resolution for our `min-size:auto` value.
+  // We don't need to check for scrollable overflow in a particular axis
+  // because this will be true for both or neither axis.
   mNeedsMinSizeAutoResolution =
       IsAutoOrEnumOnBSize(mainMinSize, IsInlineAxisMainAxis()) &&
-      disp->mOverflowX == StyleOverflow::Visible;
+      !disp->IsScrollableOverflow();
 }
 
 nscoord FlexItem::GetBaselineOffsetFromOuterCrossEdge(
     AxisEdgeType aEdge, const FlexboxAxisTracker& aAxisTracker,
     bool aUseFirstLineBaseline) const {
   // NOTE:
   //  * We only use baselines for aligning in the flex container's cross axis.
   //  * Baselines are a measurement in the item's block axis.