Avoid recomputing inline_content_sizes() when not needed (#33806)

The result of `inline_content_sizes()` may depend on the block size of
the containing block, so we were always recomputing in case we got
a different block size.

However, if no content has a vertical percentage or stretches vertically,
then we don't need to recompute: the result will be the same anyways.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Oriol Brufau 2024-10-14 18:06:27 +02:00 committed by GitHub
parent 821bed1d11
commit b9ed45942d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 257 additions and 139 deletions

View file

@ -137,7 +137,7 @@ impl Table {
IndependentFormattingContext::NonReplaced(NonReplacedFormattingContext {
base_fragment_info: (&anonymous_info).into(),
style: grid_and_wrapper_style,
content_sizes: None,
content_sizes_result: None,
contents: NonReplacedFormattingContextContents::Table(table),
})
}
@ -858,7 +858,7 @@ where
context: ArcRefCell::new(NonReplacedFormattingContext {
style: info.style.clone(),
base_fragment_info: info.into(),
content_sizes: None,
content_sizes_result: None,
contents,
}),
};