Bug 1964510 - Remove unnecessary pre-checks from ShouldApplyAutoMinSize r=TYLin

Differential Revision: https://phabricator.services.mozilla.com/D247832
This commit is contained in:
Emily McDonough
2025-05-07 19:44:12 +00:00
committed by emcdonough@mozilla.com
parent 27ff199fb4
commit f4e3c4ba50

View File

@@ -912,16 +912,13 @@ struct nsGridContainerFrame::GridItemInfo {
// of the item is content-based.
// https://drafts.csswg.org/css-grid-2/#min-size-auto
//
// @note the caller should also check that the item spans at least one track
// that has a min track sizing function that is 'auto' before applying it.
// @note the caller should also check that the item has a span length of 1,
// and that the item's track has a min track sizing function that is 'auto'.
bool ShouldApplyAutoMinSize(WritingMode aContainerWM,
LogicalAxis aContainerAxis) const {
if ((mState[aContainerAxis] & StateBits::eIsFlexing) &&
mArea.LineRangeForAxis(aContainerAxis).Extent() > 1) {
// If the item spans multiple tracks in a given axis, none of those
// tracks may be flexible.
return false;
}
MOZ_ASSERT(
mArea.LineRangeForAxis(aContainerAxis).Extent() == 1,
"Should not be called with grid items that span multiple tracks.");
const LogicalAxis itemAxis =
aContainerWM.IsOrthogonalTo(mFrame->GetWritingMode())
? GetOrthogonalAxis(aContainerAxis)