Issue #1370 - Part 2: Remove redundant special-case code for treating flex-basis enum values as 'auto' in vertical axis

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1436881
This commit is contained in:
FranklinDM 2022-04-06 22:44:31 +08:00 committed by roytam1
commit b6b20a04ec

View file

@ -4647,19 +4647,11 @@ nsFrame::SetCoordToFlexBasis(bool aIsInlineFlexItem,
return;
}
// Override whichever styleCoord is in the flex container's main axis
if (aIsInlineFlexItem) {
*aInlineStyle = aFlexBasis;
} else {
// One caveat for vertical flex items: We don't support enumerated
// values (e.g. "max-content") for height properties yet. So, if our
// computed flex-basis is an enumerated value, we'll just behave as if
// it were "auto", which means "use the main-size property after all"
// (which is "height", in this case).
// NOTE: Once we support intrinsic sizing keywords for "height",
// we should remove this check.
if (aFlexBasis->GetUnit() != eStyleUnit_Enumerated) {
*aBlockStyle = aFlexBasis;
}
*aBlockStyle = aFlexBasis;
}
}