layout: Avoid useless LazyCell when resolving replaced element's size (#37419)

The callback can be used instead, since `Size::resolve()` already takes
care of creating a `LazyCell`.

Testing: Unnecessary, no behavior change

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-06-13 10:29:37 +02:00 committed by GitHub
parent 23acb623c8
commit 1bbdcb1911
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -536,7 +536,7 @@ impl ReplacedContents {
);
// Now we can compute the block size, using the inline size from above.
let block_content_size = LazyCell::new(|| -> ContentSizes {
let get_block_content_size = || -> ContentSizes {
let get_inline_size = || SizeConstraint::Definite(inline_size);
self.content_size(
Direction::Block,
@ -545,13 +545,13 @@ impl ReplacedContents {
&get_block_fallback_size,
)
.into()
});
};
let block_size = sizes.block.resolve(
Direction::Block,
automatic_size.block,
Au::zero,
block_stretch_size,
|| *block_content_size,
get_block_content_size,
false, /* is_table */
);