Bug 178928 - [Web Animations] Expose the currentTime property on AnimationTimeline
Summary: [Web Animations] Expose the currentTime property on AnimationTimeline
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-27 01:49 PDT by Antoine Quint
Modified: 2017-10-31 06:41 PDT (History)
6 users (show)

See Also:


Attachments
Patch (8.08 KB, patch)
2017-10-27 01:52 PDT, 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 2017-10-27 01:49:47 PDT
[Web Animations] Expose the currentTime property on AnimationTimeline
Comment 1 Antoine Quint 2017-10-27 01:52:10 PDT
Created attachment 325141 [details]
Patch
Comment 2 Dean Jackson 2017-10-27 03:32:43 PDT
Comment on attachment 325141 [details]
Patch

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

> Source/WebCore/animation/AnimationTimeline.cpp:57
> +    if (m_currentTime)

Flip this logic around. Put the nullopt case in the if.

> LayoutTests/webanimations/timeline-current-time.html:11
> +internals.setTimelineCurrentTime(document.timeline, 1);

Should also test null and negative values.
Comment 3 Antoine Quint 2017-10-27 03:49:03 PDT
(In reply to Dean Jackson from comment #2)
> Comment on attachment 325141 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=325141&action=review
> 
> > Source/WebCore/animation/AnimationTimeline.cpp:57
> > +    if (m_currentTime)
> 
> Flip this logic around. Put the nullopt case in the if.

Will do.

> > LayoutTests/webanimations/timeline-current-time.html:11
> > +internals.setTimelineCurrentTime(document.timeline, 1);
> 
> Should also test null and negative values.

We don't support null values as it stands, I'm not sure there's much sense in that since a timeline cannot go back to having a null currentTime once it's started having one.

I'll add a test for a negative time.
Comment 4 Antoine Quint 2017-10-27 13:30:06 PDT
Committed r224128: <https://trac.webkit.org/changeset/224128>
Comment 5 Radar WebKit Bug Importer 2017-10-31 06:41:08 PDT
<rdar://problem/35271080>