Issue #1838 - Part 5: Address follow-up issues to initial flexbox layout for (column|row)-gap properties

Notes:
* Bug 1473044 - Make flexbox cross size take row/column gap into account
https://bugzilla.mozilla.org/show_bug.cgi?id=1473044
* Bug 1473047 - Re-resolve row-gap percentages after intrinsic block size calculated
https://bugzilla.mozilla.org/show_bug.cgi?id=1473047
* Bug 1612401 - Prevent absolute-positioned children from contributing gap size to flexbox's inline-size
https://bugzilla.mozilla.org/show_bug.cgi?id=1612401
* Bug 1639627 - Make flex-container percent 'row-gap' values resolve to 0, when they're resolved against an indefinite block-size (essentially reverts Bug 1473047)
This commit is contained in:
FranklinDM 2022-04-02 20:11:59 +08:00 committed by roytam1
commit 57d616da4c

View file

@ -2330,7 +2330,7 @@ private:
// XXX this should be uint16_t when we add explicit fallback handling
uint8_t mAlignContent;
nscoord mCrossGapSize = 0;
const nscoord mCrossGapSize;
};
// Utility class for managing our position along the cross axis, *within* a
@ -4473,6 +4473,11 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
// Now that we've finished with this line's items, size the line itself:
line->ComputeCrossSizeAndBaseline(aAxisTracker);
sumLineCrossSizes += line->GetLineCrossSize();
// Add the cross axis gap space if this is not the last line
if (line->getNext()) {
sumLineCrossSizes += aCrossGapSize;
}
}
bool isCrossSizeDefinite;
@ -4934,6 +4939,11 @@ nsFlexContainerFrame::GetIntrinsicISize(nsRenderingContext* aRenderingContext,
bool onFirstChild = true;
for (nsIFrame* childFrame : mFrames) {
// Skip out-of-flow children because they don't participate in flex layout.
if (childFrame->GetType() == nsGkAtoms::placeholderFrame) {
continue;
}
nscoord childISize = nsLayoutUtils::IntrinsicForContainer(
aRenderingContext, childFrame, aType);
// * For a row-oriented single-line flex container, the intrinsic