[Web Animations] Positive delays of accelerated animations are not respected
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Sep 2018 19:05:31 +0000 (19:05 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Sep 2018 19:05:31 +0000 (19:05 +0000)
commit0905dbed9f7e0ab56e0ebf8adf8fcb2bd19e1d4a
treea461f04e28a2281cdf6df4dc82f134cac10632d1
parent9c68436049ca225b347b5fa014aa78626bf3857c
[Web Animations] Positive delays of accelerated animations are not respected
https://bugs.webkit.org/show_bug.cgi?id=189411
<rdar://problem/44151416>

Reviewed by Dean Jackson.

Source/WebCore:

Test: webanimations/accelerated-animation-with-delay-and-seek.html

We were only accounting for negative delays for accelerated actions. We also were misbehaving
when seeking an animation with a delay (positive or negative) since we wouldn't reset the animation
begin time to be the current time when adjusting its time offset, while the begin time set when
first creating the animation would be set accounting for the time offset.

* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::seekCAAnimationOnLayer):

LayoutTests:

Add a test that checks that positive delays are accounted for during accelerated actions, including a seek.

* webanimations/accelerated-animation-with-delay-and-seek-expected.html: Added.
* webanimations/accelerated-animation-with-delay-and-seek.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235854 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/webanimations/accelerated-animation-with-delay-and-seek-expected.html [new file with mode: 0644]
LayoutTests/webanimations/accelerated-animation-with-delay-and-seek.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/animation/KeyframeEffectReadOnly.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp