Bug 1647520 Part 3 - Improve some comments in FindBestBalanceBSize(). r=heycam
authorTing-Yu Lin <tlin@mozilla.com>
Mon, 20 Jul 2020 22:27:44 +0000
changeset 541375 d6ce5fef610a01d6479b9193d19835baadac4149
parent 541374 a6b19393adea61bee190ae2b79417ea49f71f482
child 541376 19047c90effa4666c26ea57cafe40b2df3a76aef
push id122202
push useraethanyc@gmail.com
push dateMon, 20 Jul 2020 23:04:12 +0000
treeherderautoland@19047c90effa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1647520
milestone80.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 1647520 Part 3 - Improve some comments in FindBestBalanceBSize(). r=heycam Here's an example that can break the loop at the first iteration. <div style="column-count:2; height:100px"><img src="" style="height:500px"> Differential Revision: https://phabricator.services.mozilla.com/D83731
layout/generic/nsColumnSetFrame.cpp
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -1008,17 +1008,17 @@ void nsColumnSetFrame::FindBestBalanceBS
   // last column's available block-size is unbounded.
   bool foundFeasibleBSizeCloserToBest = !aUnboundedLastColumn;
 
   while (!aPresContext->HasPendingInterrupt()) {
     nscoord lastKnownFeasibleBSize = aConfig.mKnownFeasibleBSize;
 
     // Record what we learned from the last reflow
     if (aColData.mFeasible) {
-      // maxBSize is feasible. Also, mLastBalanceBSize is feasible.
+      // mMaxBSize is feasible. Also, mLastBalanceBSize is feasible.
       aConfig.mKnownFeasibleBSize =
           std::min(aConfig.mKnownFeasibleBSize, aColData.mMaxBSize);
       aConfig.mKnownFeasibleBSize =
           std::min(aConfig.mKnownFeasibleBSize, mLastBalanceBSize);
 
       // Furthermore, no block-size less than the block-size of the last
       // column can ever be feasible. (We might be able to reduce the
       // block-size of a non-last column by moving content to a later column,
@@ -1050,17 +1050,19 @@ void nsColumnSetFrame::FindBestBalanceBS
     }
 
     COLUMN_SET_LOG(
         "%s: this=%p, mKnownInfeasibleBSize=%d, mKnownFeasibleBSize=%d",
         __func__, this, aConfig.mKnownInfeasibleBSize,
         aConfig.mKnownFeasibleBSize);
 
     if (aConfig.mKnownInfeasibleBSize >= aConfig.mKnownFeasibleBSize - 1) {
-      // aConfig.mKnownFeasibleBSize is where we want to be
+      // aConfig.mKnownFeasibleBSize is where we want to be. This can happen in
+      // the very first iteration when a column container solely has a tall
+      // unbreakable child that overflows the container.
       break;
     }
 
     if (aConfig.mKnownInfeasibleBSize >= availableContentBSize) {
       // There's no feasible block-size to fit our contents. We may need to
       // reflow one more time after this loop.
       break;
     }