Bug 248927

Summary: length values in gradients should take effective zoom into account
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: CSSAssignee: Fujii Hironori <Hironori.Fujii>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, esprehn+autocc, ews-watchlist, glenn, kondapallykalyan, pdr, sam, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=18511
Attachments:
Description Flags
linear-gradient-and-zoom.html
none
radial-gradient-and-zoom.html
none
WIP patch
none
Patch
none
Patch none

Description Fujii Hironori 2022-12-07 20:12:39 PST
Created attachment 463932 [details]
linear-gradient-and-zoom.html

absolute length values in gradients should take effective zoom into account
Comment 1 Fujii Hironori 2022-12-07 20:12:54 PST
Created attachment 463933 [details]
radial-gradient-and-zoom.html
Comment 2 Fujii Hironori 2022-12-07 22:30:01 PST
Created attachment 463935 [details]
WIP patch
Comment 3 Fujii Hironori 2022-12-08 13:26:09 PST
Created attachment 463948 [details]
Patch
Comment 4 Simon Fraser (smfr) 2022-12-09 08:25:18 PST
Comment on attachment 463948 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=463948&action=review

> Source/WebCore/rendering/style/StyleGradientImage.cpp:671
> +static float positionFromValue(const CSSPrimitiveValue& initialValue, const CSSToLengthConversionData& conversionData, const FloatSize& size, bool isHorizontal, const RenderStyle& style)

Instead of passing the style in more places, should we put the effectiveZoom value into CSSToLengthConversionData? In fact, CSSToLengthConversionData seems to have the style already.
Comment 5 Fujii Hironori 2022-12-09 12:01:14 PST
Comment on attachment 463948 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=463948&action=review

>> Source/WebCore/rendering/style/StyleGradientImage.cpp:671
>> +static float positionFromValue(const CSSPrimitiveValue& initialValue, const CSSToLengthConversionData& conversionData, const FloatSize& size, bool isHorizontal, const RenderStyle& style)
> 
> Instead of passing the style in more places, should we put the effectiveZoom value into CSSToLengthConversionData? In fact, CSSToLengthConversionData seems to have the style already.

Will fix. Thank you.
Comment 6 Fujii Hironori 2022-12-09 12:03:01 PST
Created attachment 463969 [details]
Patch
Comment 7 Simon Fraser (smfr) 2022-12-09 12:18:49 PST
Comment on attachment 463969 [details]
Patch

So much cleaner!
Comment 8 EWS 2022-12-09 18:23:02 PST
Committed 257659@main (18a30951bbec): <https://commits.webkit.org/257659@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 463969 [details].
Comment 9 Radar WebKit Bug Importer 2022-12-09 18:24:16 PST
<rdar://problem/103202297>
Comment 10 Fujii Hironori 2022-12-11 13:31:34 PST
*** Bug 248906 has been marked as a duplicate of this bug. ***