Bug 189445 - Correctly interpret from angle for conic gradients
Summary: Correctly interpret from angle for conic gradients
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Megan Gardner
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-09-07 17:52 PDT by Megan Gardner
Modified: 2018-09-10 17:53 PDT (History)
5 users (show)

See Also:


Attachments
Patch (6.90 KB, patch)
2018-09-07 17:58 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (6.89 KB, patch)
2018-09-07 18:12 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Megan Gardner 2018-09-07 17:52:04 PDT
Correctly interperate from angle for conic gradients
Comment 1 Megan Gardner 2018-09-07 17:58:41 PDT
Created attachment 349221 [details]
Patch
Comment 2 Megan Gardner 2018-09-07 17:59:28 PDT
<rdar://problem/44158271>
Comment 3 Tim Horton 2018-09-07 18:02:39 PDT
interperate is not a word
Comment 4 Megan Gardner 2018-09-07 18:12:16 PDT
Created attachment 349224 [details]
Patch
Comment 5 Simon Fraser (smfr) 2018-09-08 12:23:21 PDT
Comment on attachment 349224 [details]
Patch

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

> Source/WebCore/css/CSSGradientValue.cpp:1439
> -        angle = m_angle->floatValue(CSSPrimitiveValue::CSS_DEG);
> +        angle = m_angle->floatValue(CSSPrimitiveValue::CSS_RAD);

How do you know this is radians? It looks like consumeAngle() can use whatever units the source specified.
Comment 6 Megan Gardner 2018-09-10 14:56:52 PDT
Because this is what is fed to CG, and CG wants radians. It's the only thing it's used for.
Comment 7 WebKit Commit Bot 2018-09-10 15:23:13 PDT
Comment on attachment 349224 [details]
Patch

Clearing flags on attachment: 349224

Committed r235868: <https://trac.webkit.org/changeset/235868>
Comment 8 WebKit Commit Bot 2018-09-10 15:23:15 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Simon Fraser (smfr) 2018-09-10 15:28:04 PDT
(In reply to Megan Gardner from comment #6)
> Because this is what is fed to CG, and CG wants radians. It's the only thing
> it's used for.

But this is cross-platform code. I think ConicData needs to rename 'angle' to 'angleRadians' or at least have a comments saying that it's Radians. Ideally, we'd have a typedef.
Comment 10 Megan Gardner 2018-09-10 17:53:23 PDT
Follow up fix for Simon's naming request
https://trac.webkit.org/changeset/235877/webkit