From ae20cdbdc9490435789adf72d37a6768d0dd54f6 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Sun, 15 Jun 2025 18:11:18 +0200 Subject: [PATCH] layout: Ensure that min/max-content sizes ignore sizing properties (#37464) This amends #37457 so that the min-content and max-content inline sizes of a replaced element stop depending on the value of the inline sizing properties. In practice I don't think this has any observable effect, but now the code obeys https://drafts.csswg.org/css-sizing-3/#intrinsic-sizes, and it's simpler. Testing: Unneeded Signed-off-by: Oriol Brufau --- components/layout/replaced.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/layout/replaced.rs b/components/layout/replaced.rs index 8bd1da619ee..46c179c6c14 100644 --- a/components/layout/replaced.rs +++ b/components/layout/replaced.rs @@ -551,13 +551,14 @@ impl ReplacedContents { // First, compute the inline size. Intrinsic values depend on the block sizing properties // through the aspect ratio, but these can also be intrinsic and depend on the inline size. // Therefore, when there is an aspect ratio, we may need to: - // 1. Tentatively resolve the inline size, ignoring block sizing properties. + // 1. Tentatively resolve the inline size, ignoring sizing properties in both axes + // (i.e. resulting in the inline fallback size). // 2. Tentatively resolve the block size, resolving intrinsic keywords by transferring (1). // 3. Resolve the final inline size, resolving intrinsic keywords by transferring (2). // 4. Resolve the final block size, resolving intrinsic keywords by transferring (3). let inline_size = resolve_inline_size(&|| { SizeConstraint::Definite(resolve_block_size(&|| { - SizeConstraint::Definite(resolve_inline_size(&|| SizeConstraint::default())) + SizeConstraint::Definite(get_inline_fallback_size()) })) }); LogicalVec2 {