Bug 247298 - Don't apply aspect ratio scaling to gradient images without a natural aspect ratio
Summary: Don't apply aspect ratio scaling to gradient images without a natural aspect ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Matt Woodrow
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-10-31 17:06 PDT by Matt Woodrow
Modified: 2022-11-02 16:30 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Woodrow 2022-10-31 17:06:24 PDT
If we use a gradient as a background image, and set one of the background size dimension to auto, we currently scale that dimension by the same amount as the other axis to preserve the aspect ratio.

Gradients have no natural dimensions (and thus no natural aspect ratio) - https://w3c.github.io/csswg-drafts/css-images/#gradients.

Background sizing should fall back to using 100% (for the case where we have one size, and auto), if there's no natural aspect ratio or dimensions - https://w3c.github.io/csswg-drafts/css-backgrounds/#background-size

<rdar://101661731>
Comment 1 Matt Woodrow 2022-10-31 17:15:12 PDT
Pull request: https://github.com/WebKit/WebKit/pull/5987
Comment 2 EWS 2022-11-02 16:30:16 PDT
Committed 256256@main (759576401a3d): <https://commits.webkit.org/256256@main>

Reviewed commits have been landed. Closing PR #5987 and removing active labels.