[Web Animations] Allow getComputedStyle() to return animated values for accelerated...
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Nov 2017 13:30:36 +0000 (13:30 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Nov 2017 13:30:36 +0000 (13:30 +0000)
commitbf84ab3f879d056a02324fdcc9a15a66125a84a9
tree624b3cad5a0c821ad25816f61402060ba72c725c
parent812aa42e5549128b46eb02a25efe6f7295d34620
[Web Animations] Allow getComputedStyle() to return animated values for accelerated animations
https://bugs.webkit.org/show_bug.cgi?id=179975
<rdar://problem/35676811>

Reviewed by Dean Jackson.

Source/WebCore:

In case we're running an accelerated animation, we are not blending RenderStyles as the animation
progresses and thus we need to hook into computeRenderStyleForProperty() to query the DocumentTimeline
for the animated style of running accelerated animations where we blend styles manually for the
animation's current time.

Test: http/wpt/wk-web-animations/interfaces/keyframe-effect-getComputedStyle.html

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::animatedStyleForRenderer): Iterate through all running accelerated animations
for the element to which the provided renderer is attached and ask for their animated styles.
* animation/DocumentTimeline.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::getAnimatedStyle): Manually blend all animated properties and populate the provided
RenderStyle with their values, creating the RenderStyle if needed.
* animation/KeyframeEffect.h:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computeRenderStyleForProperty): Query the DocumentTimeline for accelerated animated properties in
case such animations are running, otherwise let the CSS animation controller report the animated values.

LayoutTests:

Add a new test that checks that the computed style of accelerated animation returns the animated value.
This test would fail for the accelerated case prior to this patch.

* http/wpt/wk-web-animations/interfaces/keyframe-effect-getComputedStyle-expected.txt: Added.
* http/wpt/wk-web-animations/interfaces/keyframe-effect-getComputedStyle.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225133 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/wpt/wk-web-animations/interfaces/keyframe-effect-getComputedStyle-expected.txt [new file with mode: 0644]
LayoutTests/http/wpt/wk-web-animations/interfaces/keyframe-effect-getComputedStyle.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/animation/DocumentTimeline.cpp
Source/WebCore/animation/DocumentTimeline.h
Source/WebCore/animation/KeyframeEffect.cpp
Source/WebCore/animation/KeyframeEffect.h
Source/WebCore/css/CSSComputedStyleDeclaration.cpp