mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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:
parent
23acb623c8
commit
1bbdcb1911
1 changed files with 3 additions and 3 deletions
|
@ -536,7 +536,7 @@ impl ReplacedContents {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Now we can compute the block size, using the inline size from above.
|
// 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);
|
let get_inline_size = || SizeConstraint::Definite(inline_size);
|
||||||
self.content_size(
|
self.content_size(
|
||||||
Direction::Block,
|
Direction::Block,
|
||||||
|
@ -545,13 +545,13 @@ impl ReplacedContents {
|
||||||
&get_block_fallback_size,
|
&get_block_fallback_size,
|
||||||
)
|
)
|
||||||
.into()
|
.into()
|
||||||
});
|
};
|
||||||
let block_size = sizes.block.resolve(
|
let block_size = sizes.block.resolve(
|
||||||
Direction::Block,
|
Direction::Block,
|
||||||
automatic_size.block,
|
automatic_size.block,
|
||||||
Au::zero,
|
Au::zero,
|
||||||
block_stretch_size,
|
block_stretch_size,
|
||||||
|| *block_content_size,
|
get_block_content_size,
|
||||||
false, /* is_table */
|
false, /* is_table */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue