Bug 247298

Summary: Don't apply aspect ratio scaling to gradient images without a natural aspect ratio
Product: WebKit Reporter: Matt Woodrow <mattwoodrow>
Component: Layout and RenderingAssignee: Matt Woodrow <mattwoodrow>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

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.