diff options
author | Oriol Brufau <obrufau@igalia.com> | 2024-11-28 13:57:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-28 12:57:38 +0000 |
commit | a37ccc3e64c92e8ba10a3cdc48ebd7f031bb7298 (patch) | |
tree | e66e22153a3ed1e59019c0e50806265402dbf4e3 /components/layout_2020/taffy/layout.rs | |
parent | 895b8d30eac41afbdbd20efd65c5a6e58ae3f43d (diff) | |
download | servo-a37ccc3e64c92e8ba10a3cdc48ebd7f031bb7298.tar.gz servo-a37ccc3e64c92e8ba10a3cdc48ebd7f031bb7298.zip |
Use natural ratio for `object-fit` (#34413)
We were using the preferred aspect ratio provided by the `aspect-ratio`
property instead of the natural aspect ratio. However, the preferred
aspect ratio should only be used to size the replaced element. To paint
the replaced contents into that element we need the natural ratio.
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 | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/components/layout_2020/taffy/layout.rs b/components/layout_2020/taffy/layout.rs index 03c76b3bf85..0dae5299cbe 100644 --- a/components/layout_2020/taffy/layout.rs +++ b/components/layout_2020/taffy/layout.rs @@ -175,11 +175,9 @@ impl taffy::LayoutPartialTree for TaffyContainerContext<'_> { // Create fragments if the RunMode if PerformLayout // If the RunMode is ComputeSize then only the returned size will be used if inputs.run_mode == RunMode::PerformLayout { - child.child_fragments = replaced.contents.make_fragments( - &replaced.style, - containing_block, - content_box_size, - ); + child.child_fragments = replaced + .contents + .make_fragments(&replaced.style, content_box_size); } let computed_size = taffy::Size { |