Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,18 @@ static void computeFlexBasisForChild(
resolvedFlexBasis.isDefined() && yoga::isDefined(mainAxisSize);

if (useResolvedFlexBasis) {
// A basis computed earlier in this layout may come from the item's
// content, if the container was first measured with no main size. Replace
// it once the container has an exact main size, where the items flex from
// their flex bases. A container sized by its content within an available
// size keeps it, as the item's contribution to that size.
const bool hasExactMainSize =
(isMainAxisRow ? widthMode : heightMode) == SizingMode::StretchFit;
if (child->getLayout().computedFlexBasis.isUndefined() ||
(child->getConfig()->isExperimentalFeatureEnabled(
ExperimentalFeature::WebFlexBasis) &&
child->getLayout().computedFlexBasisGeneration != generationCount)) {
(hasExactMainSize ||
child->getLayout().computedFlexBasisGeneration != generationCount))) {
const FloatOptional paddingAndBorder = FloatOptional(
paddingAndBorderForAxis(child, mainAxis, direction, ownerWidth));
child->setLayoutComputedFlexBasis(
Expand Down
Loading