Title: [233462] trunk
- Revision
- 233462
- Author
- [email protected]
- Date
- 2018-07-03 08:01:55 -0700 (Tue, 03 Jul 2018)
Log Message
REGRESSION (r232186): Hardware-accelerated CSS animations using steps() timing function no longer work
https://bugs.webkit.org/show_bug.cgi?id=186129
Patch by Frederic Wang <[email protected]> on 2018-07-03
Reviewed by Antoine Quint.
Source/WebCore:
When the WebAnimationsCSSIntegration flag is enabled, animating the transform property with
a steps() timing function no longer works. This is because the WebAnimation code wrongly
assumes that the transform property can always be accelerated (for counterexamples, see
GraphicsLayerCA::animationCanBeAccelerated). For consistency with AnimationBase, we make
WebAnimation fallback to non-accelerated mode when RenderBoxModelObject::startAnimation
fails. This addresses the regression previously mentioned.
Test: http/wpt/css/css-animations/start-animation-001.html
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Fallback to
non-accelerated mode if startAnimation failed.
LayoutTests:
Add a test to ensure that accelerated and non-accelerated animations are properly started
when WebAnimationsCSSIntegration is enabled. In particular, consider the case of animated
transform using steps() timing function.
* http/wpt/css/css-animations/start-animation-001-expected.html: Added.
* http/wpt/css/css-animations/start-animation-001.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (233461 => 233462)
--- trunk/LayoutTests/ChangeLog 2018-07-03 10:41:37 UTC (rev 233461)
+++ trunk/LayoutTests/ChangeLog 2018-07-03 15:01:55 UTC (rev 233462)
@@ -1,3 +1,17 @@
+2018-07-03 Frederic Wang <[email protected]>
+
+ REGRESSION (r232186): Hardware-accelerated CSS animations using steps() timing function no longer work
+ https://bugs.webkit.org/show_bug.cgi?id=186129
+
+ Reviewed by Antoine Quint.
+
+ Add a test to ensure that accelerated and non-accelerated animations are properly started
+ when WebAnimationsCSSIntegration is enabled. In particular, consider the case of animated
+ transform using steps() timing function.
+
+ * http/wpt/css/css-animations/start-animation-001-expected.html: Added.
+ * http/wpt/css/css-animations/start-animation-001.html: Added.
+
2018-07-03 Frederic Wang <[email protected]>
[iOS] Animations with Bézier timing function not suspended on UI process when animation-play-state is set to "paused"
Added: trunk/LayoutTests/http/wpt/css/css-animations/start-animation-001-expected.html (0 => 233462)
--- trunk/LayoutTests/http/wpt/css/css-animations/start-animation-001-expected.html (rev 0)
+++ trunk/LayoutTests/http/wpt/css/css-animations/start-animation-001-expected.html 2018-07-03 15:01:55 UTC (rev 233462)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Verify that animations properly start (reference)</title>
+ <style>
+ #container {
+ position: absolute;
+ left: 0;
+ top: 3em;
+ }
+ #coveringRect {
+ background: blue;
+ position: absolute;
+ top: -10px;
+ left: 90px;
+ width: 5000px;
+ height: 500px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>This test passes if green squares are moved behind the blue rectangle.</p>
+ <div id="container">
+ <div id="coveringRect"></div>
+ </div>
+ </body>
+</html>
Added: trunk/LayoutTests/http/wpt/css/css-animations/start-animation-001.html (0 => 233462)
--- trunk/LayoutTests/http/wpt/css/css-animations/start-animation-001.html (rev 0)
+++ trunk/LayoutTests/http/wpt/css/css-animations/start-animation-001.html 2018-07-03 15:01:55 UTC (rev 233462)
@@ -0,0 +1,76 @@
+<!DOCTYPE html><!-- webkit-test-runner [ enableWebAnimationsCSSIntegration=true ] -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Verify that animations properly start</title>
+ <style>
+ #container {
+ position: absolute;
+ left: 0;
+ top: 3em;
+ }
+ #squareLinear, #squareSteps, #squareNonAccelerated {
+ width: 100px;
+ height: 100px;
+ background: lightblue;
+ position: absolute;
+ }
+ /* Avoid animation-fill-mode, to make sure that the move is done by the animation code. */
+ #squareLinear {
+ top: 0px;
+ animation: moveByTransform 10s linear;
+ }
+ #squareSteps {
+ top: 150px;
+ animation: moveByTransform 10s steps(1000);
+ }
+ #squareNonAccelerated {
+ top: 300px;
+ animation: moveByLeft 10s steps(100);
+ }
+ @keyframes moveByTransform
+ {
+ 100% {
+ transform: translate(5000px);
+ }
+ }
+ @keyframes moveByLeft
+ {
+ 0% {
+ left: 0px;
+ }
+ 100% {
+ left: 5000px;
+ }
+ }
+ #coveringRect {
+ background: blue;
+ position: absolute;
+ top: -10px;
+ left: 90px;
+ width: 5000px;
+ height: 500px;
+ }
+ </style>
+ <script>
+ function runTest() {
+ if (!window.testRunner)
+ return;
+ // We wait a bit after the squares are moved behind the blue rectangle. For discontinuous
+ // transforms we have 5000px / 100 steps = 5px/step. Hence this happens after 20 steps i.e.
+ // 20/100*10s = 200ms.
+ testRunner.waitUntilDone();
+ setTimeout(() => { testRunner.notifyDone(); }, 300);
+ }
+ </script>
+ </head>
+ <body _onload_="runTest()">
+ <p>This test passes if green squares are moved behind the blue rectangle.</p>
+ <div id="container">
+ <div id="squareLinear"><tt>transform</tt> (linear)</div>
+ <div id="squareSteps"><tt>transform</tt> (steps)</div>
+ <div id="squareNonAccelerated"><tt>left</tt> (steps)</div>
+ <div id="coveringRect"></div>
+ </div>
+ </body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (233461 => 233462)
--- trunk/Source/WebCore/ChangeLog 2018-07-03 10:41:37 UTC (rev 233461)
+++ trunk/Source/WebCore/ChangeLog 2018-07-03 15:01:55 UTC (rev 233462)
@@ -1,3 +1,23 @@
+2018-07-03 Frederic Wang <[email protected]>
+
+ REGRESSION (r232186): Hardware-accelerated CSS animations using steps() timing function no longer work
+ https://bugs.webkit.org/show_bug.cgi?id=186129
+
+ Reviewed by Antoine Quint.
+
+ When the WebAnimationsCSSIntegration flag is enabled, animating the transform property with
+ a steps() timing function no longer works. This is because the WebAnimation code wrongly
+ assumes that the transform property can always be accelerated (for counterexamples, see
+ GraphicsLayerCA::animationCanBeAccelerated). For consistency with AnimationBase, we make
+ WebAnimation fallback to non-accelerated mode when RenderBoxModelObject::startAnimation
+ fails. This addresses the regression previously mentioned.
+
+ Test: http/wpt/css/css-animations/start-animation-001.html
+
+ * animation/KeyframeEffectReadOnly.cpp:
+ (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Fallback to
+ non-accelerated mode if startAnimation failed.
+
2018-07-03 David Kilzer <[email protected]>
[iOS] Add assert to catch improper use of WebCore::Timer in UI Process
Modified: trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp (233461 => 233462)
--- trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp 2018-07-03 10:41:37 UTC (rev 233461)
+++ trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp 2018-07-03 15:01:55 UTC (rev 233462)
@@ -1254,7 +1254,11 @@
for (const auto& action : pendingAccelerationActions) {
switch (action) {
case AcceleratedAction::Play:
- compositedRenderer->startAnimation(timeOffset, backingAnimationForCompositedRenderer().ptr(), m_blendingKeyframes);
+ if (!compositedRenderer->startAnimation(timeOffset, backingAnimationForCompositedRenderer().ptr(), m_blendingKeyframes)) {
+ m_shouldRunAccelerated = false;
+ m_lastRecordedAcceleratedAction = AcceleratedAction::Stop;
+ return;
+ }
break;
case AcceleratedAction::Pause:
compositedRenderer->animationPaused(timeOffset, m_blendingKeyframes.animationName());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes