Bug 231443 - [css-ui] Fix interpolation of accent-color
Summary: [css-ui] Fix interpolation of accent-color
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aditya Keerthi
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-08 11:53 PDT by Aditya Keerthi
Modified: 2021-10-12 06:48 PDT (History)
5 users (show)

See Also:


Attachments
Patch (47.83 KB, patch)
2021-10-08 11:58 PDT, Aditya Keerthi
graouts: review+
Details | Formatted Diff | Diff
Patch for landing (47.83 KB, patch)
2021-10-11 17:26 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aditya Keerthi 2021-10-08 11:53:43 PDT
...
Comment 1 Aditya Keerthi 2021-10-08 11:54:02 PDT
rdar://84037162
Comment 2 Aditya Keerthi 2021-10-08 11:58:59 PDT
Created attachment 440652 [details]
Patch
Comment 3 Antoine Quint 2021-10-11 05:46:28 PDT
Comment on attachment 440652 [details]
Patch

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

Very nice! Thanks for catching this and fixing it Aditya.

> Source/WebCore/animation/CSSPropertyAnimation.cpp:1490
> +        auto& blendingRenderStyle = context.progress < 0.5 ? from : to;

If canInterpolate(from, to) is false, then progress should have already been set to either 0 or 1 in CSSPropertyAnimation::blendProperties(). I think you should ASSERT() that you're only dealing with 0 or 1 here and change this line to `auto& blendingRenderStyle = context.progress ? from : to;`.
Comment 4 Antoine Quint 2021-10-11 05:46:47 PDT
Comment on attachment 440652 [details]
Patch

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

Very nice! Thanks for catching this and fixing it Aditya.

>> Source/WebCore/animation/CSSPropertyAnimation.cpp:1490
>> +        auto& blendingRenderStyle = context.progress < 0.5 ? from : to;
> 
> If canInterpolate(from, to) is false, then progress should have already been set to either 0 or 1 in CSSPropertyAnimation::blendProperties(). I think you should ASSERT() that you're only dealing with 0 or 1 here and change this line to `auto& blendingRenderStyle = context.progress ? from : to;`.

If canInterpolate(from, to) is false, then progress should have already been set to either 0 or 1 in CSSPropertyAnimation::blendProperties(). I think you should ASSERT() that you're only dealing with 0 or 1 here and change this line to `auto& blendingRenderStyle = context.progress ? from : to;`.
Comment 5 Aditya Keerthi 2021-10-11 17:26:47 PDT
Created attachment 440865 [details]
Patch for landing
Comment 6 Aditya Keerthi 2021-10-11 17:27:48 PDT
(In reply to Antoine Quint from comment #4)
> Comment on attachment 440652 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=440652&action=review
> 
> Very nice! Thanks for catching this and fixing it Aditya.

Thanks for the review!

> >> Source/WebCore/animation/CSSPropertyAnimation.cpp:1490
> >> +        auto& blendingRenderStyle = context.progress < 0.5 ? from : to;
> > 
> > If canInterpolate(from, to) is false, then progress should have already been set to either 0 or 1 in CSSPropertyAnimation::blendProperties(). I think you should ASSERT() that you're only dealing with 0 or 1 here and change this line to `auto& blendingRenderStyle = context.progress ? from : to;`.
> 
> If canInterpolate(from, to) is false, then progress should have already been
> set to either 0 or 1 in CSSPropertyAnimation::blendProperties(). I think you
> should ASSERT() that you're only dealing with 0 or 1 here and change this
> line to `auto& blendingRenderStyle = context.progress ? from : to;`.

Added the assertion.

I think you meant `auto& blendingRenderStyle = context.progress ? to : from;` :)
Comment 7 Antoine Quint 2021-10-12 06:16:40 PDT
(In reply to Aditya Keerthi from comment #6)
> (In reply to Antoine Quint from comment #4)
> > Comment on attachment 440652 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=440652&action=review
> I think you meant `auto& blendingRenderStyle = context.progress ? to :
> from;` :)

Absolutely!
Comment 8 EWS 2021-10-12 06:48:28 PDT
Committed r283980 (242826@main): <https://commits.webkit.org/242826@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 440865 [details].