[Web Animations] Expose the playbackRate property on Animation
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Oct 2017 15:09:02 +0000 (15:09 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Oct 2017 15:09:02 +0000 (15:09 +0000)
commit130b0201d2b0b4466f25a923cdd11351ff369c16
tree16d760a122b741af0a81c29ed4adc8cf959f0328
parent6e67f665193296dff36fcc5fab4e6455cfecd5e1
[Web Animations] Expose the playbackRate property on Animation
https://bugs.webkit.org/show_bug.cgi?id=178931

Reviewed by Sam Weinig.

Source/WebCore:

Account for the playback rate when computing and setting an animation's
current time, ensuring that we adjust the start time to preserve the
current time when setting a new playback rate.

Test: http/wpt/wk-web-animations/timing-model/animation-playback-rate.html

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::WebAnimation):
(WebCore::WebAnimation::currentTime const):
(WebCore::WebAnimation::setCurrentTime):
(WebCore::WebAnimation::setPlaybackRate):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:

LayoutTests:

Add a new test, using WPT, to check that the playbackRate property is accounted
for when getting and setting the current time.

* http/wpt/wk-web-animations/timing-model/animation-playback-rate-expected.txt: Added.
* http/wpt/wk-web-animations/timing-model/animation-playback-rate.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/wpt/wk-web-animations/timing-model/animation-playback-rate-expected.txt [new file with mode: 0644]
LayoutTests/http/wpt/wk-web-animations/timing-model/animation-playback-rate.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/animation/WebAnimation.cpp
Source/WebCore/animation/WebAnimation.h
Source/WebCore/animation/WebAnimation.idl