Bug 181857 - [Web Animations] Expose timing properties (delay, endDelay, fill, iterationStart, iterations, direction) and getComputedTiming()
Summary: [Web Animations] Expose timing properties (delay, endDelay, fill, iterationSt...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-19 08:45 PST by Antoine Quint
Modified: 2018-01-19 09:57 PST (History)
3 users (show)

See Also:


Attachments
Patch (138.20 KB, patch)
2018-01-19 09:17 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (138.17 KB, patch)
2018-01-19 09:23 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 2018-01-19 08:45:56 PST
We need to expose most of the timing properties on AnimationEffecTiming, namely:

- delay
- endDelay
- fill
- iterationStart
- iterations
- direction

… and also AnimationEffect::getComputedTiming() which exposes the computed values for those properties and some of the already-exposed properties.
Comment 1 Radar WebKit Bug Importer 2018-01-19 09:10:05 PST
<rdar://problem/36660081>
Comment 2 Antoine Quint 2018-01-19 09:17:57 PST
Created attachment 331739 [details]
Patch
Comment 3 EWS Watchlist 2018-01-19 09:21:13 PST
Attachment 331739 [details] did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:20:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 43 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Antoine Quint 2018-01-19 09:23:03 PST
Created attachment 331740 [details]
Patch
Comment 5 Dean Jackson 2018-01-19 09:44:24 PST
Comment on attachment 331740 [details]
Patch

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

> Source/WebCore/animation/AnimationEffect.cpp:65
> +    else
> +        computedTiming.localTime = std::nullopt;

Wouldn't this be the default value anyway?

> Source/WebCore/animation/ComputedTimingProperties.h:38
> +    double endTime;
> +    double activeDuration;
> +    std::optional<double> localTime;
> +    std::optional<double> progress;
> +    std::optional<double> currentIteration;

Add some default values here.

> Source/WebCore/animation/WebAnimationUtilities.h:32
> +inline double secondsToWebAnimationsAPITime(const Seconds time)

Could you just put this in an existing header that is already included by everything?
Comment 6 Antoine Quint 2018-01-19 09:48:28 PST
(In reply to Dean Jackson from comment #5)
> Comment on attachment 331740 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=331740&action=review
> 
> > Source/WebCore/animation/AnimationEffect.cpp:65
> > +    else
> > +        computedTiming.localTime = std::nullopt;
> 
> Wouldn't this be the default value anyway?

Good point, I'll check.

> > Source/WebCore/animation/ComputedTimingProperties.h:38
> > +    double endTime;
> > +    double activeDuration;
> > +    std::optional<double> localTime;
> > +    std::optional<double> progress;
> > +    std::optional<double> currentIteration;
> 
> Add some default values here.

These are _always_ computed, I'm not sure there's any value in that.

> > Source/WebCore/animation/WebAnimationUtilities.h:32
> > +inline double secondsToWebAnimationsAPITime(const Seconds time)
> 
> Could you just put this in an existing header that is already included by
> everything?

None that I could find.
Comment 7 Antoine Quint 2018-01-19 09:57:01 PST
Committed r227208: <https://trac.webkit.org/changeset/227208>