Reviewed by Darin Adler.
KeyframeAnimation::animate() needs to compute the elapsed animation time
properly taking into account its paused state.
https://bugs.webkit.org/show_bug.cgi?id=22773
Test: animations/animation-drt-api-multiple-keyframes.html
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::animate):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39176
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2008-12-10 Pierre-Olivier Latour <pol@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Added a test to verify that the DRT API pauseAnimationAtTimeOnElementWithId() does work
+ with animations using multiple keyframes.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22773
+
+ * animations/animation-drt-api-multiple-keyframes.html: Added.
+ * platform/mac/animations/animation-drt-api-multiple-keyframes-expected.checksum: Added.
+ * platform/mac/animations/animation-drt-api-multiple-keyframes-expected.png: Added.
+ * platform/mac/animations/animation-drt-api-multiple-keyframes-expected.txt: Added.
+ * platform/win/Skipped:
+
2008-12-10 Hironori Bono <hbono@chromium.org>
Reviewed by Alexey Proskuryakov.
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <style>
+ body {
+ margin: 0;
+ }
+
+ div {
+ position: relative;
+ left: 100px;
+ height: 200px;
+ width: 200px;
+ background-color: red;
+ -webkit-animation-name: anim;
+ -webkit-animation-duration: 5s;
+ -webkit-animation-timing-function: linear;
+ }
+
+ @-webkit-keyframes anim {
+ from { left: 10px; }
+ 40% { left: 30px; }
+ 60% { left: 15px; }
+ to { left: 20px; }
+ }
+
+ </style>
+ <script type="text/javascript" charset="utf-8">
+ function startTest() {
+ if (window.layoutTestController) {
+ if (!layoutTestController.pauseAnimationAtTimeOnElementWithId("anim", 3, "box"))
+ throw("Animation is not running");
+ }
+ }
+ </script>
+</head>
+<body onload="startTest()">
+ <h1>Test for DRT pauseAnimationAtTimeOnElementWithId() API on animations with multiple keyframes</h1>
+
+ <div id="box">
+ </div>
+
+</body>
+</html>
--- /dev/null
+e04c89890048c38895b300318c022f32
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x316
+ RenderBlock {HTML} at (0,0) size 800x316
+ RenderBody {BODY} at (0,21) size 800x295
+ RenderBlock {H1} at (0,0) size 800x74
+ RenderText {#text} at (0,0) size 799x74
+ text run at (0,0) width 799: "Test for DRT pauseAnimationAtTimeOnElementWithId()"
+ text run at (0,37) width 599: "API on animations with multiple keyframes"
+layer at (15,116) size 200x200
+ RenderBlock (relative positioned) {DIV} at (0,95) size 200x200 [bgcolor=#FF0000]
# No transition / animation pause LayoutController API on Windows DRT (https://bugs.webkit.org/show_bug.cgi?id=22239)
animations/animation-drt-api.html
+animations/animation-drt-api-multiple-keyframes.html
transitions/transition-drt-api.html
transitions/transition-drt-api-delay.html
transitions/transition-shorthand-delay.html
+2008-12-10 Pierre-Olivier Latour <pol@apple.com>
+
+ Reviewed by Darin Adler.
+
+ KeyframeAnimation::animate() needs to compute the elapsed animation time
+ properly taking into account its paused state.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22773
+
+ Test: animations/animation-drt-api-multiple-keyframes.html
+
+ * page/animation/KeyframeAnimation.cpp:
+ (WebCore::KeyframeAnimation::animate):
+
2008-12-10 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dan Bernstein
// We should cache the last pair or something.
// Find the first key
- double elapsedTime = (m_startTime > 0) ? ((!paused() ? currentTime() : m_pauseTime) - m_startTime) : 0;
+ double elapsedTime = (m_startTime > 0 || m_pauseTime > 0) ? ((!paused() ? currentTime() : m_pauseTime) - m_startTime) : 0;
if (elapsedTime < 0)
elapsedTime = 0;