Bug 1548118 Part 4 - Always mark inner ColumnSetWrapper's children dirty before reflowing it if the outer ColumnSetWrapper is balancing. r=dbaron
authorTing-Yu Lin <tlin@mozilla.com>
Wed, 08 May 2019 03:12:18 +0000
changeset 531816 cef0cd7882055d20b8db85c0d717fdd52122f577
parent 531815 970a59a74aed7c06d25e9da071d527c86d829f9a
child 531817 c464e9d2f4b810cb4da5651c5c5e14c5c9ab1080
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1548118
milestone68.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 1548118 Part 4 - Always mark inner ColumnSetWrapper's children dirty before reflowing it if the outer ColumnSetWrapper is balancing. r=dbaron ColumnSetFrame always tries to reflow column content regardless of it's dirtiness. Making ColumnSetWrapperFrame's children dirty can have the same effect. Differential Revision: https://phabricator.services.mozilla.com/D29435
layout/generic/nsBlockFrame.cpp
layout/reftests/columns/reftest.list
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -3362,16 +3362,25 @@ void nsBlockFrame::ReflowBlockFrame(Bloc
       MOZ_ASSERT(cbReflowInput->mFrame->StyleColumn()->IsColumnContainerStyle(),
                  "Get unexpected reflow input of multicol containing block!");
 
       // Use column-width as the containing block's inline-size, i.e. the column
       // content's computed inline-size.
       cbSize.emplace(LogicalSize(wm, aState.mReflowInput.ComputedISize(),
                                  cbReflowInput->ComputedBSize())
                          .ConvertTo(frame->GetWritingMode(), wm));
+
+      // If a ColumnSetWrapper is in a balancing column content, it may be
+      // pushed or pulled back and forth between column contents. Always add
+      // NS_FRAME_HAS_DIRTY_CHILDREN bit to it so that its ColumnSet children
+      // can have a chance to reflow under current block size constraint.
+      if (aState.mReflowInput.mFlags.mIsColumnBalancing &&
+          frame->IsColumnSetWrapperFrame()) {
+        frame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
+      }
     }
 
     blockReflowInput.emplace(
         aState.mPresContext, aState.mReflowInput, frame,
         availSpace.Size(wm).ConvertTo(frame->GetWritingMode(), wm), cbSize);
 
     nsFloatManager::SavedState floatManagerState;
     nsReflowStatus frameReflowStatus;
--- a/layout/reftests/columns/reftest.list
+++ b/layout/reftests/columns/reftest.list
@@ -44,10 +44,10 @@ pref(layout.css.column-span.enabled,true
 pref(layout.css.column-span.enabled,true) == first-line-first-letter.html first-line-first-letter-ref.html
 
 # The following lines are duplicates of other lines from further up in this
 # manifest. They're listed again here so we can re-run these tests with
 # column-span enabled. These lines can be removed once the pref becomes
 # default-enabled (Bug 1426010).
 default-preferences pref(layout.css.column-span.enabled,true)
 fails == min-width-2.html min-width-2-ref.html # Bug 1548100
-fails == column-balancing-nested-001.html column-balancing-nested-001-ref.html # Bug 1548118
+== column-balancing-nested-001.html column-balancing-nested-001-ref.html
 default-preferences