mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
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>
This commit is contained in:
parent
895b8d30ea
commit
a37ccc3e64
8 changed files with 10 additions and 32 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue