Bug 204010 - [Web Animations] Use a keyframe effect stack to resolve animations on an element
Summary: [Web Animations] Use a keyframe effect stack to resolve animations on an element
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: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-11-08 10:01 PST by Antoine Quint
Modified: 2019-11-08 12:42 PST (History)
8 users (show)

See Also:


Attachments
Patch (34.67 KB, patch)
2019-11-08 10:19 PST, Antoine Quint
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2019-11-08 10:01:53 PST
[Web Animations] Use a keyframe effect stack to resolve animations on an element
Comment 1 Antoine Quint 2019-11-08 10:19:06 PST
Created attachment 383140 [details]
Patch
Comment 2 Dean Jackson 2019-11-08 10:24:33 PST
Comment on attachment 383140 [details]
Patch

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

> Source/WebCore/animation/KeyframeEffect.cpp:1009
> +    bool animationChanged = animation != this->animation();
> +    AnimationEffect::setAnimation(animation);
> +    if (m_target && animationChanged) {

Would it read better as this?
{
   AnimationEffect::setAnimation(animation);
   if (m_target && animation != this->animation()) {...

I'm not sure.
Comment 3 Antoine Quint 2019-11-08 12:32:49 PST
(In reply to Dean Jackson from comment #2)
> Comment on attachment 383140 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=383140&action=review
> 
> > Source/WebCore/animation/KeyframeEffect.cpp:1009
> > +    bool animationChanged = animation != this->animation();
> > +    AnimationEffect::setAnimation(animation);
> > +    if (m_target && animationChanged) {
> 
> Would it read better as this?
> {
>    AnimationEffect::setAnimation(animation);
>    if (m_target && animation != this->animation()) {...
> 
> I'm not sure.

Once AnimationEffect::setAnimation(animation) is called, `animation` and `this->animation()` are guaranteed to return the same thing. That's why it's required to determine whether the value changed before calling the superclass's implementation.
Comment 4 Antoine Quint 2019-11-08 12:41:07 PST
Committed r252253: <https://trac.webkit.org/changeset/252253>
Comment 5 Radar WebKit Bug Importer 2019-11-08 12:42:15 PST
<rdar://problem/57031112>