mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
layout: Respect alignment when sizing replaced abspos (#35085)
If an absolutely position element which is replaced has `justify-self` or `align-self` set to `stretch`, and no inset is `auto` on that axis, then an automatic size should behave as `stretch`, not as `fit-content`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
2965b2fda7
commit
f6c166533e
9 changed files with 92 additions and 69 deletions
|
@ -1972,18 +1972,21 @@ impl FlexItem<'_> {
|
|||
containing_block,
|
||||
item_style,
|
||||
self.preferred_aspect_ratio,
|
||||
&Sizes::new(
|
||||
block_size
|
||||
.to_definite()
|
||||
.map_or(Size::Initial, Size::Numeric),
|
||||
Size::Numeric(min_size.block),
|
||||
max_size.block.map_or(Size::Initial, Size::Numeric),
|
||||
),
|
||||
&Sizes::new(
|
||||
Size::Numeric(inline_size),
|
||||
Size::Numeric(min_size.inline),
|
||||
max_size.inline.map_or(Size::Initial, Size::Numeric),
|
||||
),
|
||||
LogicalVec2 {
|
||||
block: &Sizes::new(
|
||||
block_size
|
||||
.to_definite()
|
||||
.map_or(Size::Initial, Size::Numeric),
|
||||
Size::Numeric(min_size.block),
|
||||
max_size.block.map_or(Size::Initial, Size::Numeric),
|
||||
),
|
||||
inline: &Sizes::new(
|
||||
Size::Numeric(inline_size),
|
||||
Size::Numeric(min_size.inline),
|
||||
max_size.inline.map_or(Size::Initial, Size::Numeric),
|
||||
),
|
||||
},
|
||||
Size::FitContent.into(),
|
||||
flex_axis.vec2_to_flow_relative(self.pbm_auto_is_zero),
|
||||
);
|
||||
let hypothetical_cross_size = flex_axis.vec2_to_flex_relative(size).cross;
|
||||
|
@ -2792,22 +2795,25 @@ impl FlexItemBox {
|
|||
flex_context.containing_block,
|
||||
style,
|
||||
preferred_aspect_ratio,
|
||||
&Sizes::new(
|
||||
content_box_size
|
||||
.block
|
||||
.non_auto()
|
||||
.map_or(Size::Initial, Size::Numeric),
|
||||
Size::Numeric(min_size.block),
|
||||
max_size.block.map_or(Size::Initial, Size::Numeric),
|
||||
),
|
||||
&Sizes::new(
|
||||
content_box_size
|
||||
.inline
|
||||
.non_auto()
|
||||
.map_or(Size::Initial, Size::Numeric),
|
||||
Size::Numeric(min_size.inline),
|
||||
max_size.inline.map_or(Size::Initial, Size::Numeric),
|
||||
),
|
||||
LogicalVec2 {
|
||||
block: &Sizes::new(
|
||||
content_box_size
|
||||
.block
|
||||
.non_auto()
|
||||
.map_or(Size::Initial, Size::Numeric),
|
||||
Size::Numeric(min_size.block),
|
||||
max_size.block.map_or(Size::Initial, Size::Numeric),
|
||||
),
|
||||
inline: &Sizes::new(
|
||||
content_box_size
|
||||
.inline
|
||||
.non_auto()
|
||||
.map_or(Size::Initial, Size::Numeric),
|
||||
Size::Numeric(min_size.inline),
|
||||
max_size.inline.map_or(Size::Initial, Size::Numeric),
|
||||
),
|
||||
},
|
||||
Size::FitContent.into(),
|
||||
padding_border_margin.padding_border_sums +
|
||||
padding_border_margin.margin.auto_is(Au::zero).sum(),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue