Bug 1661874 Part 2 - Remove the support of ColumnSetFrame being an abs.pos container. r=heycam
authorTing-Yu Lin <tlin@mozilla.com>
Mon, 31 Aug 2020 03:45:15 +0000
changeset 546970 d1bacf3c0f3f368167e84c0c6ad8af7a78d124d6
parent 546969 6bc1452132f5643d14c942277c152a0913e1e8c7
child 546971 84313d82b10a30871d3309e08c7a95957b6b2e81
push id125312
push useraethanyc@gmail.com
push dateMon, 31 Aug 2020 03:54:51 +0000
treeherderautoland@cc4b6a85883f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1661874
milestone82.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 1661874 Part 2 - Remove the support of ColumnSetFrame being an abs.pos container. r=heycam The support of this was added in https://hg.mozilla.org/mozilla-central/rev/fb0790d28846 After supporting column-span, ColumnSetFrame isn't the top-level multicol container anymore, and is not served as an abs.pos container. Thus, we can simply the reflow code a bit. Differential Revision: https://phabricator.services.mozilla.com/D88698
layout/generic/nsColumnSetFrame.cpp
layout/generic/nsColumnSetFrame.h
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -1213,34 +1213,20 @@ void nsColumnSetFrame::Reflow(nsPresCont
 
   MOZ_ASSERT(aReflowInput.mCBReflowInput->mFrame->StyleColumn()
                  ->IsColumnContainerStyle(),
              "The column container should have relevant column styles!");
   MOZ_ASSERT(aReflowInput.mParentReflowInput->mFrame->IsColumnSetWrapperFrame(),
              "The column container should be ColumnSetWrapperFrame!");
   MOZ_ASSERT(aReflowInput.ComputedLogicalBorderPadding().IsAllZero(),
              "Only the column container can have border and padding!");
-
-#ifdef DEBUG
-  nsFrameList::Enumerator oc(GetChildList(kOverflowContainersList));
-  for (; !oc.AtEnd(); oc.Next()) {
-    MOZ_ASSERT(!IS_TRUE_OVERFLOW_CONTAINER(oc.get()));
-  }
-  nsFrameList::Enumerator eoc(GetChildList(kExcessOverflowContainersList));
-  for (; !eoc.AtEnd(); eoc.Next()) {
-    MOZ_ASSERT(!IS_TRUE_OVERFLOW_CONTAINER(eoc.get()));
-  }
-#endif
-
-  nsOverflowAreas ocBounds;
-  nsReflowStatus ocStatus;
-  if (GetPrevInFlow()) {
-    ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds,
-                                    ReflowChildFlags::Default, ocStatus);
-  }
+  MOZ_ASSERT(GetChildList(kOverflowContainersList).IsEmpty() &&
+                 GetChildList(kExcessOverflowContainersList).IsEmpty(),
+             "ColumnSetFrame should store overflow containers in principal "
+             "child list!");
 
   //------------ Handle Incremental Reflow -----------------
 
   // If inline size is unconstrained, set aForceAuto to true to allow
   // the columns to expand in the inline direction. (This typically
   // happens in orthogonal flows where the inline direction is the
   // container's block direction).
   ReflowConfig config = ChooseColumnStrategy(
@@ -1272,22 +1258,19 @@ void nsColumnSetFrame::Reflow(nsPresCont
     aStatus.Reset();
   }
 
   NS_ASSERTION(aStatus.IsFullyComplete() ||
                    aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE,
                "Column set should be complete if the available block-size is "
                "unconstrained");
 
-  // Merge overflow container bounds and status.
-  aDesiredSize.mOverflowAreas.UnionWith(ocBounds);
-  aStatus.MergeCompletionStatusFrom(ocStatus);
-
-  FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput,
-                                 aStatus, false);
+  MOZ_ASSERT(!HasAbsolutelyPositionedChildren(),
+             "ColumnSetWrapperFrame should be the abs.pos container!");
+  FinishAndStoreOverflow(&aDesiredSize, aReflowInput.mStyleDisplay);
 
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
 void nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
                                         const nsDisplayListSet& aLists) {
   DisplayBorderBackgroundOutline(aBuilder, aLists);
 
--- a/layout/generic/nsColumnSetFrame.h
+++ b/layout/generic/nsColumnSetFrame.h
@@ -6,17 +6,16 @@
 
 #ifndef nsColumnSetFrame_h___
 #define nsColumnSetFrame_h___
 
 /* rendering object for css3 multi-column layout */
 
 #include "mozilla/Attributes.h"
 #include "nsContainerFrame.h"
-#include "nsIFrameInlines.h"  // for methods used by IS_TRUE_OVERFLOW_CONTAINER
 
 /**
  * nsColumnSetFrame implements CSS multi-column layout.
  * @note nsColumnSetFrame keeps true overflow containers in the normal flow
  * child lists (i.e. the principal and overflow lists).
  */
 class nsColumnSetFrame final : public nsContainerFrame {
  public:
@@ -45,21 +44,16 @@ class nsColumnSetFrame final : public ns
     nsIFrame* frame = PrincipalChildList().FirstChild();
 
     // if no children return nullptr
     if (!frame) return nullptr;
 
     return frame->GetContentInsertionFrame();
   }
 
-  bool IsFrameOfType(uint32_t aFlags) const override {
-    return nsContainerFrame::IsFrameOfType(
-        aFlags & ~(nsIFrame::eCanContainOverflowContainers));
-  }
-
   void BuildDisplayList(nsDisplayListBuilder* aBuilder,
                         const nsDisplayListSet& aLists) override;
 
   /**
    * Similar to nsBlockFrame::DrainOverflowLines. Locate any columns not
    * handled by our prev-in-flow, and any columns sitting on our own
    * overflow list, and put them in our primary child list for reflowing.
    */