Bug 248927 - length values in gradients should take effective zoom into account
Summary: length values in gradients should take effective zoom into account
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
: 248906 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-12-07 20:12 PST by Fujii Hironori
Modified: 2022-12-11 13:31 PST (History)
9 users (show)

See Also:


Attachments
linear-gradient-and-zoom.html (379 bytes, text/html)
2022-12-07 20:12 PST, Fujii Hironori
no flags Details
radial-gradient-and-zoom.html (420 bytes, text/html)
2022-12-07 20:12 PST, Fujii Hironori
no flags Details
WIP patch (6.48 KB, patch)
2022-12-07 22:30 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (9.25 KB, patch)
2022-12-08 13:26 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (4.03 KB, patch)
2022-12-09 12:03 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***