layout: Add style to ConstraintSpace and IndefiniteContainingBlock (#39229)

They only had the writing mode, now they will have the entire computed
style.
This is needed for #39230.

Testing: Not needed, no behavior change

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-09-11 23:53:14 +02:00 committed by GitHub
parent dfdcba88d4
commit 9e9bd80bba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 44 additions and 62 deletions

View file

@ -175,14 +175,14 @@ pub(crate) fn outer_inline(
available_block_size,
)
};
ConstraintSpace::new(block_size, style.writing_mode, aspect_ratio)
ConstraintSpace::new(block_size, style, aspect_ratio)
} else {
// This assumes that there is no preferred aspect ratio, or that there is no
// block size constraint to be transferred so the ratio is irrelevant.
// We only get into here for anonymous blocks, for which the assumption holds.
ConstraintSpace::new(
containing_block.size.block.into(),
containing_block.writing_mode,
containing_block.style,
None,
)
};
@ -246,13 +246,14 @@ pub(crate) fn outer_inline(
// We need a comment here to avoid breaking `./mach test-tidy`.
matches!(size, Size::Numeric(numeric) if numeric.has_percentage())
};
let writing_mode = containing_block.style.writing_mode;
if content_box_sizes.inline.preferred.is_initial() &&
has_percentage(style.box_size(containing_block.writing_mode).inline)
has_percentage(style.box_size(writing_mode).inline)
{
preferred_min_content = Au::zero();
}
if content_box_sizes.inline.max.is_initial() &&
has_percentage(style.max_box_size(containing_block.writing_mode).inline)
has_percentage(style.max_box_size(writing_mode).inline)
{
max_min_content = Some(Au::zero());
}