Bug 178928

Summary: [Web Animations] Expose the currentTime property on AnimationTimeline
Product: WebKit Reporter: Antoine Quint <graouts>
Component: AnimationsAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, cdumez, dino, esprehn+autocc, kondapallykalyan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=122912
Attachments:
Description Flags
Patch dino: review+

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>