layout: Fix intrinsic contributions of anonymous blocks (#34719)

In order to compute the inline min-content and max-content contributions
of an anonymous block, we were finding its min-content and max-content
inline size with a SizeConstraint coming from the block size of the box.

However, anonymous blocks do not establish a containing block for their
contents, so this patch uses a SizeConstraint from the block size of the
containing block.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2024-12-21 22:42:21 -08:00 committed by GitHub
parent 1157fa28b3
commit 09408ae10b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 91 additions and 22 deletions

View file

@ -871,6 +871,14 @@ impl SizeConstraint {
}
}
impl From<AuOrAuto> for SizeConstraint {
fn from(size: AuOrAuto) -> Self {
size.non_auto()
.map(SizeConstraint::Definite)
.unwrap_or_default()
}
}
#[derive(Clone, Default)]
pub(crate) struct Sizes {
/// <https://drafts.csswg.org/css-sizing-3/#preferred-size-properties>