mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
layout_2020: Specify the used cross size when replaced item is stretched
If the flex item has align-self: stretch, redo layout for its contents, reating this used size as its definite cross size so that percentage-sized children can be resolved.
This commit is contained in:
parent
1dbd74f389
commit
77e13260d0
1 changed files with 8 additions and 1 deletions
|
@ -1003,10 +1003,17 @@ impl<'a> FlexItem<'a> {
|
|||
let pbm = replaced
|
||||
.style
|
||||
.padding_border_margin(flex_context.containing_block);
|
||||
let box_size = used_cross_size_override.map(|size| Vec2 {
|
||||
inline: replaced
|
||||
.style
|
||||
.content_box_size(flex_context.containing_block, &pbm)
|
||||
.inline,
|
||||
block: LengthOrAuto::LengthPercentage(size),
|
||||
});
|
||||
let size = replaced.contents.used_size_as_if_inline_element(
|
||||
flex_context.containing_block,
|
||||
&replaced.style,
|
||||
None,
|
||||
box_size,
|
||||
&pbm,
|
||||
);
|
||||
let cross_size = flex_context.vec2_to_flex_relative(size.clone()).cross;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue