mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
layout: Allow lazy resolution of automatic minimum sizes (#35965)
`Size::resolve_for_min()` had an `Au` parameter, representing the value to be used for an automatic minimum size. However, this amount isn't trivial to compute in flexbox, so this patch changes the parameter to a function that can be called lazily. Note flexbox isn't currently using `Size::resolve_for_min()`, but it will in #35961. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
62d6759106
commit
7cf2fc88a0
5 changed files with 20 additions and 20 deletions
|
@ -1715,7 +1715,7 @@ impl InitialFlexLineLayout<'_> {
|
|||
item.item.content_cross_sizes.resolve(
|
||||
axis,
|
||||
Size::Stretch,
|
||||
Au::zero(),
|
||||
Au::zero,
|
||||
Some(final_line_cross_size - item.item.pbm_auto_is_zero.cross),
|
||||
|| content_size.into(),
|
||||
// Tables have a special sizing in the block axis in that handles collapsed rows,
|
||||
|
@ -1966,7 +1966,7 @@ impl FlexItem<'_> {
|
|||
self.content_cross_sizes.resolve(
|
||||
Direction::Inline,
|
||||
automatic_size,
|
||||
Au::zero(),
|
||||
Au::zero,
|
||||
Some(stretch_size),
|
||||
get_content_size,
|
||||
self.is_table(),
|
||||
|
@ -2117,7 +2117,7 @@ impl FlexItem<'_> {
|
|||
self.content_cross_sizes.resolve(
|
||||
Direction::Block,
|
||||
Size::FitContent,
|
||||
Au::zero(),
|
||||
Au::zero,
|
||||
stretch_size,
|
||||
|| content_block_size.into(),
|
||||
self.is_table(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue