summaryrefslogtreecommitdiff
path: root/layout/generic
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2022-04-02 20:11:59 +0800
committerFranklinDM <mrmineshafter17@gmail.com>2022-04-02 23:14:25 +0800
commitf3707e0637314e4e13a240d7cdaf797e709a36e8 (patch)
tree520d0b6e73d738f11eb4cd3907c0b99fdf2eb219 /layout/generic
parented8d7f13914404f048c3a57c5000f524179c3d89 (diff)
downloaduxp-f3707e0637314e4e13a240d7cdaf797e709a36e8.tar.gz
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)
Diffstat (limited to 'layout/generic')
-rw-r--r--layout/generic/nsFlexContainerFrame.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp
index 9b5372832c..4429111e46 100644
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -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