Bug 1926015 Part 2 - Construct a percentage basis when calling MinISize() in nsIFrame::ComputeSize(). r=dholbert

We should construct a percentage basis like we did in
nsIFrame::ComputeISizeValue().
https://searchfox.org/mozilla-central/rev/75de397838825ba741820fec27225342ba15fd5b/layout/generic/nsIFrame.cpp#7076-7082

This is necessary to pass `intrinsic-percent-replaced-027.html` (added in the
next part).

Differential Revision: https://phabricator.services.mozilla.com/D229750
This commit is contained in:
Ting-Yu Lin 2024-11-21 19:55:32 +00:00
parent ba5729110e
commit 976d9d9584

View File

@ -6577,9 +6577,13 @@ nsIFrame::SizeComputationResult nsIFrame::ComputeSize(
result.ISize(aWM) = std::min(maxISize, result.ISize(aWM));
}
const IntrinsicSizeInput input(aRenderingContext,
Some(aCBSize.ConvertTo(GetWritingMode(), aWM)),
Nothing());
const nscoord bSizeAsPercentageBasis = ComputeBSizeValueAsPercentageBasis(
styleBSize, minBSizeCoord, maxBSizeCoord, aCBSize.BSize(aWM),
boxSizingAdjust.BSize(aWM));
const IntrinsicSizeInput input(
aRenderingContext, Some(aCBSize.ConvertTo(GetWritingMode(), aWM)),
Some(LogicalSize(aWM, NS_UNCONSTRAINEDSIZE, bSizeAsPercentageBasis)
.ConvertTo(GetWritingMode(), aWM)));
const auto& minISizeCoord = stylePos->MinISize(aWM);
nscoord minISize;
if (!minISizeCoord.IsAuto() && !shouldIgnoreMinMaxISize) {