Bug 1614101 - Make sure ColumnSet does not split in the last reflow if ColumnSetWrapper's available block-size is unconstrained. r=dbaron, a=RyanVM
authorTing-Yu Lin <tlin@mozilla.com>
Wed, 04 Mar 2020 18:21:01 +0000
changeset 579432 47bc0dc40c851e869295e0c6b16050eb8c21f4c9
parent 579431 f875f6df03c56211dc9b1751258157563e5d7729
child 579433 f1df9c949f8bb0fac871ae5e3b5620cbbc211fbb
push id2279
push userryanvm@gmail.com
push dateWed, 04 Mar 2020 22:30:17 +0000
treeherdermozilla-release@dc1684693eed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron, RyanVM
bugs1614101, 1015844
milestone74.0
Bug 1614101 - Make sure ColumnSet does not split in the last reflow if ColumnSetWrapper's available block-size is unconstrained. r=dbaron, a=RyanVM Checking ColumnSet's available block-size [1] makes no sense nowadays because ColumnSet is an inner frame under ColumnSetWrapper. We should check ColumnSetWrapper's available block-size instead. Also, bump assertions count for 1015844.html on Android, which is a crashtest having multicols. [1] The comment was also misleading, which said it was checking ColumnSet's "block-size", but it actually was checking available block-size. Differential Revision: https://phabricator.services.mozilla.com/D63385
layout/generic/crashtests/crashtests.list
layout/generic/nsColumnSetFrame.cpp
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -568,17 +568,17 @@ load 973701-2.xhtml
 load 986899.html
 load 1001233.html
 load 1001258-1.html
 load 1001994.html
 load chrome://reftest/content/crashtests/layout/generic/crashtests/1003441.xhtml
 load 1015562.html
 asserts(1-2) asserts-if(Android,1-3) load 1015563-1.html
 asserts(1-2) load 1015563-2.html
-asserts-if(Android,21) load 1015844.html
+asserts-if(Android,48) load 1015844.html
 asserts-if(Android,0-358) pref(font.size.inflation.minTwips,200) load 1032450.html # Bug 1607658
 load 1032613-1.svg
 load 1032613-2.html
 load 1037903.html
 load 1039454-1.html
 load 1042489.html
 load 1054010-1.html
 load 1058954-1.html
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -1166,23 +1166,27 @@ void nsColumnSetFrame::FindBestBalanceBS
           // container's next-in-flows.
           aConfig = ChooseColumnStrategy(aReflowInput, true);
         }
       }
     } else {
       aConfig.mColMaxBSize = aConfig.mKnownFeasibleBSize;
     }
 
-    // If our block-size is unconstrained, make sure that the last column is
+    // This is our last attempt to reflow. If our column container's available
+    // block-size is unconstrained, make sure that the last column is
     // allowed to have arbitrary block-size here, even though we were
     // balancing. Otherwise we'd have to split, and it's not clear what we'd
     // do with that.
+    const bool forceUnboundedLastColumn =
+        aReflowInput.mParentReflowInput->AvailableBSize() ==
+        NS_UNCONSTRAINEDSIZE;
     MarkPrincipalChildrenDirty(this);
     ReflowColumns(aDesiredSize, aReflowInput, aStatus, aConfig,
-                  availableContentBSize == NS_UNCONSTRAINEDSIZE);
+                  forceUnboundedLastColumn);
   }
 }
 
 void nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
                               ReflowOutput& aDesiredSize,
                               const ReflowInput& aReflowInput,
                               nsReflowStatus& aStatus) {
   MarkInReflow();