LibWeb: Calculate image size in CSS pixels #2982
Draft
+34
−34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously most of the calculations for
object-fit
andobject-position
were based on device pixels, meaning that images would render differently based on zoom and DPI settings. Instead those calculations now use css pixels and only the final draw-call is based on device-pixels.The changes in test expectation files are due to the fact that in one place image size is now correctly rounded instead of truncated, fixing an off-by-one error that was coded into those test expectations.
Draft because there is no regression test yet.
scaling-before.mp4
scaling-after.mp4