Bug 206688

Summary: [Web Animations] Support multiple CSS Animations with the same name in animation-name
Product: WebKit Reporter: Antoine Quint <graouts>
Component: AnimationsAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch dino: review+

Description Antoine Quint 2020-01-23 11:38:20 PST
[Web Animations] Support multiple CSS Animations with the same name in animation-name
Comment 1 Antoine Quint 2020-01-23 12:01:10 PST
Created attachment 388572 [details]
Patch
Comment 2 Antoine Quint 2020-01-23 12:17:14 PST
Created attachment 388577 [details]
Patch
Comment 3 Antoine Quint 2020-01-23 12:23:15 PST
Created attachment 388578 [details]
Patch
Comment 4 Antoine Quint 2020-01-24 01:52:21 PST
Created attachment 388660 [details]
Patch
Comment 5 Dean Jackson 2020-01-24 09:22:54 PST
Comment on attachment 388660 [details]
Patch

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

> Source/WebCore/animation/AnimationTimeline.cpp:224
> +    for (size_t i = 0; i < cssAnimationList->size(); ++i) {
> +        if (cssAnimationList->animation(i) == backingAnimation) {
> +            auto newAnimationList = cssAnimationList->copy();
> +            newAnimationList->remove(i);
> +            keyframeEffectStack.setCSSAnimationList(WTFMove(newAnimationList));
> +            return;
> +        }
> +    }

Why don't you add a remove() to CSSAnimationList that accepts an Animation as a parameter? Is there a reason you don't want to edit the list in place?
Comment 6 Antoine Quint 2020-01-24 09:27:25 PST
(In reply to Dean Jackson from comment #5)
> Comment on attachment 388660 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=388660&action=review
> 
> > Source/WebCore/animation/AnimationTimeline.cpp:224
> > +    for (size_t i = 0; i < cssAnimationList->size(); ++i) {
> > +        if (cssAnimationList->animation(i) == backingAnimation) {
> > +            auto newAnimationList = cssAnimationList->copy();
> > +            newAnimationList->remove(i);
> > +            keyframeEffectStack.setCSSAnimationList(WTFMove(newAnimationList));
> > +            return;
> > +        }
> > +    }
> 
> Why don't you add a remove() to CSSAnimationList that accepts an Animation
> as a parameter? Is there a reason you don't want to edit the list in place?

Yes, it comes down from RenderStyle as const.
Comment 7 Antoine Quint 2020-01-24 09:35:53 PST
Committed r255076: <https://trac.webkit.org/changeset/255076>
Comment 8 Radar WebKit Bug Importer 2020-01-24 09:36:15 PST
<rdar://problem/58870279>