mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
layout: Support stretch
cross size for automatic min size in flexbox (#35652)
The computation of the automatic minimum size may involve transferring a definite cross size into the main axis through the aspect ratio. We were only considering numeric sizes as definite, but `stretch` can also be definite. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
9d5171f3c5
commit
6aae4df909
4 changed files with 93 additions and 5 deletions
|
@ -2530,14 +2530,16 @@ impl FlexItemBox {
|
|||
Direction::Block
|
||||
};
|
||||
|
||||
let cross_stretch_size = containing_block_size
|
||||
.cross
|
||||
.map(|v| v - pbm_auto_is_zero.cross);
|
||||
let cross_size = SizeConstraint::new(
|
||||
if content_box_size.cross.is_initial() && auto_cross_size_stretches_to_container_size {
|
||||
containing_block_size
|
||||
.cross
|
||||
.map(|v| v - pbm_auto_is_zero.cross)
|
||||
cross_stretch_size
|
||||
} else {
|
||||
// TODO(#32853): handle size keywords.
|
||||
content_box_size.cross.to_numeric()
|
||||
content_box_size
|
||||
.cross
|
||||
.maybe_resolve_extrinsic(cross_stretch_size)
|
||||
},
|
||||
min_size.cross.auto_is(Au::zero),
|
||||
max_size.cross,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue