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
This commit is contained in:
Ting-Yu Lin 2020-08-31 03:45:15 +00:00
parent 218e47c67f
commit be1519920a
2 changed files with 7 additions and 30 deletions

View File

@ -1218,24 +1218,10 @@ void nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
"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 -----------------
@ -1277,12 +1263,9 @@ void nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
"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);
}

View File

@ -11,7 +11,6 @@
#include "mozilla/Attributes.h"
#include "nsContainerFrame.h"
#include "nsIFrameInlines.h" // for methods used by IS_TRUE_OVERFLOW_CONTAINER
/**
* nsColumnSetFrame implements CSS multi-column layout.
@ -50,11 +49,6 @@ class nsColumnSetFrame final : public nsContainerFrame {
return frame->GetContentInsertionFrame();
}
bool IsFrameOfType(uint32_t aFlags) const override {
return nsContainerFrame::IsFrameOfType(
aFlags & ~(nsIFrame::eCanContainOverflowContainers));
}
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) override;