diff options
author | Oriol Brufau <obrufau@igalia.com> | 2025-01-20 05:25:00 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-20 13:25:00 +0000 |
commit | f6c166533e1e324dd20d47ec3677acdbb1ae9c68 (patch) | |
tree | c7011f0093fe5ce3c0828e9eef8a2f2046de2d6e /components/layout_2020/taffy/layout.rs | |
parent | 2965b2fda7046a25e0b919a8413994f081d85d44 (diff) | |
download | servo-f6c166533e1e324dd20d47ec3677acdbb1ae9c68.tar.gz servo-f6c166533e1e324dd20d47ec3677acdbb1ae9c68.zip |
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>
Diffstat (limited to 'components/layout_2020/taffy/layout.rs')
-rw-r--r-- | components/layout_2020/taffy/layout.rs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/components/layout_2020/taffy/layout.rs b/components/layout_2020/taffy/layout.rs index ffbbbb6633c..2f58697eac3 100644 --- a/components/layout_2020/taffy/layout.rs +++ b/components/layout_2020/taffy/layout.rs @@ -161,16 +161,19 @@ impl taffy::LayoutPartialTree for TaffyContainerContext<'_> { style, independent_context .preferred_aspect_ratio(&pbm.padding_border_sums), - &Sizes::new( - option_f32_to_size(content_box_known_dimensions.height), - Size::Initial, - Size::Initial, - ), - &Sizes::new( - option_f32_to_size(content_box_known_dimensions.width), - Size::Initial, - Size::Initial, - ), + LogicalVec2 { + block: &Sizes::new( + option_f32_to_size(content_box_known_dimensions.height), + Size::Initial, + Size::Initial, + ), + inline: &Sizes::new( + option_f32_to_size(content_box_known_dimensions.width), + Size::Initial, + Size::Initial, + ), + }, + Size::FitContent.into(), pbm.padding_border_sums + pbm.margin.auto_is(Au::zero).sum(), ) .to_physical_size(self.style.writing_mode); |