Bug 121587 - [SVG] Handle endEvent for svg animations
Summary: [SVG] Handle endEvent for svg animations
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: BlinkMergeCandidate, InRadar
Depends on:
Blocks:
 
Reported: 2013-09-18 20:38 PDT by Ryosuke Niwa
Modified: 2015-10-12 14:49 PDT (History)
10 users (show)

See Also:


Attachments
Simple testcase (475 bytes, image/svg+xml)
2015-10-12 03:32 PDT, Antoine Quint
no flags Details
Patch (11.13 KB, patch)
2015-10-12 06:11 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch for landing (11.02 KB, patch)
2015-10-12 13:57 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-09-18 20:38:19 PDT
Consider merging https://chromium.googlesource.com/chromium/blink/+/4d415ca0268231aa80e3552fe21bf3480a6978f8

Handled endEvent for svg animations according to http://www.w3.org/TR/SMIL3/smil-timing.html#q135
Comment 1 Radar WebKit Bug Importer 2015-10-12 01:42:54 PDT
<rdar://problem/23067140>
Comment 2 Antoine Quint 2015-10-12 03:32:07 PDT
Created attachment 262882 [details]
Simple testcase
Comment 3 Antoine Quint 2015-10-12 06:11:59 PDT
Created attachment 262886 [details]
Patch
Comment 4 Dean Jackson 2015-10-12 11:30:37 PDT
Comment on attachment 262886 [details]
Patch

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

> Source/WebCore/svg/animation/SMILTimeContainer.cpp:272
>          AnimationsVector* scheduled = it.value.get();
> +        unsigned size = scheduled->size();
> +        for (unsigned n = 0; n < size; n++) {
> +            SVGSMILElement* animation = scheduled->at(n);
> +            if (!animation->hasConditionsConnected())
> +                animation->connectConditions();
> +        }

I think you can use a modern for loop here.

for (auto* animation : scheduled) {
  if (!animation->hasConditionsConnected())
    animation->connectConditions();
}

While here, we can come up with a better variable name than "it".

> Source/WebCore/svg/animation/SMILTimeContainer.cpp:276
> +    for (auto& it : m_scheduledAnimations) {
> +        AnimationsVector* scheduled = it.value.get();

Same here about the variable name.
Comment 5 Antoine Quint 2015-10-12 13:57:35 PDT
Created attachment 262918 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2015-10-12 14:49:08 PDT
Comment on attachment 262918 [details]
Patch for landing

Clearing flags on attachment: 262918

Committed r190890: <http://trac.webkit.org/changeset/190890>
Comment 7 WebKit Commit Bot 2015-10-12 14:49:12 PDT
All reviewed patches have been landed.  Closing bug.