LibWeb: Do not deform bitmaps partially outside the img-box

Instead of trying to manually determine which parts of a bitmap fall
within the box of the `<img>` element, just draw the whole bitmap and
let Skia clip the draw-area to the correct rectangle.

This fixes a bug where the entire bitmap was squashed into the rectangle
of the image box instead of being clipped.

With this change, image rendering is now correct enough to import some
of the WPT tests for object-fit and object-position. To get some good
coverage I have imported all tests for the `<img>` tag. I also wanted to
import a subset of the tests for the `<object>` tag, since those are
passing as well now. Unfortunately, they are flaky for unknown reasons.
This commit is contained in:
InvalidUsernameException 2025-02-04 21:51:51 +01:00 committed by Alexander Kalenik
commit e055927ead
Notes: github-actions[bot] 2025-03-05 15:33:54 +00:00
36 changed files with 1752 additions and 22 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 534 KiB

After

Width:  |  Height:  |  Size: 590 KiB

Before After
Before After