[Web Animations] Expose timing properties (delay, endDelay, fill, iterationStart...
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Jan 2018 17:56:53 +0000 (17:56 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Jan 2018 17:56:53 +0000 (17:56 +0000)
commita051138b5e81759447cde42cc9be0a09201ea124
tree32ff1a77382619446eb0fd3f5b15400e7fef94e9
parentd4ea94341d4078b89144f460c343b43c6e087d7f
[Web Animations] Expose timing properties (delay, endDelay, fill, iterationStart, iterations, direction) and getComputedTiming()
https://bugs.webkit.org/show_bug.cgi?id=181857
<rdar://problem/36660081>

Reviewed by Dean Jackson.

Source/WebCore:

We start the work to implement the rest of the Web Animations timing and animation model by exposing more properties on
AnimationEffectTiming to control delay (delay, endDelay), looping (iterationStart, iterations), fill and direction.
Additionally, we expose the getComputedTiming() method on AnimationEffect, although it currently lacks some computed
properties that will come in later patch as we implement various processes defined by the spec. We also update the
existing duration() method on AnimationEffectTiming to be called iterationDuration() to match the terms used in the
specification.

Finally, we make all new properties, and update existing ones, that expose a time value go through the new utility
function secondsToWebAnimationsAPITime() to guarantee rounded values with microseconds precision, as advised by
the Web Animations specification.

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::localTime const):
(WebCore::AnimationEffect::getComputedTiming):
* animation/AnimationEffect.h:
* animation/AnimationEffect.idl:
* animation/AnimationEffectTiming.cpp:
(WebCore::AnimationEffectTiming::AnimationEffectTiming):
(WebCore::AnimationEffectTiming::setIterationStart):
(WebCore::AnimationEffectTiming::setIterations):
(WebCore::AnimationEffectTiming::bindingsDuration const):
(WebCore::AnimationEffectTiming::setBindingsDuration):
(WebCore::AnimationEffectTiming::endTime const):
(WebCore::AnimationEffectTiming::activeDuration const):
* animation/AnimationEffectTiming.h:
* animation/AnimationEffectTiming.idl:
* animation/AnimationPlaybackEvent.cpp:
(WebCore::AnimationPlaybackEvent::bindingsCurrentTime const):
(WebCore::AnimationPlaybackEvent::bindingsTimelineTime const):
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::bindingsCurrentTime):
* animation/ComputedTimingProperties.h: Added.
* animation/ComputedTimingProperties.idl: Added. We set nullable double values to a default value of "null" since
otherwise setting those properties to a null value would not set the properties in the converted JS dictionary.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create): Handle new timing properties passed in the KeyframeEffectOptions dictionary.
(WebCore::KeyframeEffect::applyAtLocalTime):
(WebCore::KeyframeEffect::getAnimatedStyle):
(WebCore::KeyframeEffect::startOrStopAccelerated):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::bindingsStartTime const):
(WebCore::WebAnimation::bindingsCurrentTime const):
(WebCore::WebAnimation::effectEndTime const):
(WebCore::WebAnimation::timeToNextRequiredTick const):
* animation/WebAnimationUtilities.h: Added.
(WebCore::secondsToWebAnimationsAPITime):

LayoutTests:

Update expectations with progressions and new failure points now we expose more of the API.

* http/wpt/web-animations/animation-model/animation-types/discrete-animation-expected.txt:
* http/wpt/web-animations/interfaces/Animatable/animate-expected.txt:
* http/wpt/web-animations/interfaces/Animation/finish-expected.txt:
* http/wpt/web-animations/interfaces/Animation/finished-expected.txt:
* http/wpt/web-animations/interfaces/Animation/pause-expected.txt:
* http/wpt/web-animations/interfaces/Animation/play-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/delay-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/direction-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/duration-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/easing-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/endDelay-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/fill-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/iterationStart-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/iterations-expected.txt:
* http/wpt/web-animations/interfaces/AnimationTimeline/document-timeline-expected.txt:
* http/wpt/web-animations/timing-model/animation-effects/active-time-expected.txt:
* http/wpt/web-animations/timing-model/animation-effects/current-iteration-expected.txt:
* http/wpt/web-animations/timing-model/animation-effects/local-time-expected.txt:
* http/wpt/web-animations/timing-model/animation-effects/phases-and-states-expected.txt:
* http/wpt/web-animations/timing-model/animation-effects/simple-iteration-progress-expected.txt:
* http/wpt/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt:
* http/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation-expected.txt:
* http/wpt/web-animations/timing-model/time-transformations/transformed-progress-expected.txt:
* http/wpt/wk-web-animations/timing-model/keyframe-effect-interface-timing-duration.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
43 files changed:
LayoutTests/ChangeLog
LayoutTests/http/wpt/web-animations/animation-model/animation-types/discrete-animation-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/Animatable/animate-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/Animation/finish-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/Animation/finished-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/Animation/pause-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/Animation/play-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/AnimationEffectTiming/delay-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/AnimationEffectTiming/direction-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/AnimationEffectTiming/duration-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/AnimationEffectTiming/easing-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/AnimationEffectTiming/endDelay-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/AnimationEffectTiming/fill-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/AnimationEffectTiming/iterationStart-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/AnimationEffectTiming/iterations-expected.txt
LayoutTests/http/wpt/web-animations/interfaces/AnimationTimeline/document-timeline-expected.txt
LayoutTests/http/wpt/web-animations/timing-model/animation-effects/active-time-expected.txt
LayoutTests/http/wpt/web-animations/timing-model/animation-effects/current-iteration-expected.txt
LayoutTests/http/wpt/web-animations/timing-model/animation-effects/local-time-expected.txt
LayoutTests/http/wpt/web-animations/timing-model/animation-effects/phases-and-states-expected.txt
LayoutTests/http/wpt/web-animations/timing-model/animation-effects/simple-iteration-progress-expected.txt
LayoutTests/http/wpt/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt
LayoutTests/http/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation-expected.txt
LayoutTests/http/wpt/web-animations/timing-model/time-transformations/transformed-progress-expected.txt
LayoutTests/http/wpt/wk-web-animations/timing-model/keyframe-effect-interface-timing-duration.html
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/animation/AnimationEffect.cpp
Source/WebCore/animation/AnimationEffect.h
Source/WebCore/animation/AnimationEffect.idl
Source/WebCore/animation/AnimationEffectTiming.cpp
Source/WebCore/animation/AnimationEffectTiming.h
Source/WebCore/animation/AnimationEffectTiming.idl
Source/WebCore/animation/AnimationPlaybackEvent.cpp
Source/WebCore/animation/AnimationTimeline.cpp
Source/WebCore/animation/ComputedTimingProperties.h [new file with mode: 0644]
Source/WebCore/animation/ComputedTimingProperties.idl [new file with mode: 0644]
Source/WebCore/animation/KeyframeEffect.cpp
Source/WebCore/animation/WebAnimation.cpp
Source/WebCore/animation/WebAnimationUtilities.h [new file with mode: 0644]