Commit 10643665 authored by pol@apple.com's avatar pol@apple.com

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):



git-svn-id: svn://svn.chromium.org/blink/trunk@39176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e71c0e7f
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> 2008-12-10 Hironori Bono <hbono@chromium.org>
Reviewed by Alexey Proskuryakov. Reviewed by Alexey Proskuryakov.
......
<!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>
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]
...@@ -422,6 +422,7 @@ http/tests/xmlhttprequest/upload-onprogress-event.html ...@@ -422,6 +422,7 @@ http/tests/xmlhttprequest/upload-onprogress-event.html
# No transition / animation pause LayoutController API on Windows DRT (https://bugs.webkit.org/show_bug.cgi?id=22239) # 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.html
animations/animation-drt-api-multiple-keyframes.html
transitions/transition-drt-api.html transitions/transition-drt-api.html
transitions/transition-drt-api-delay.html transitions/transition-drt-api-delay.html
transitions/transition-shorthand-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> 2008-12-10 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dan Bernstein Reviewed by Dan Bernstein
...@@ -84,7 +84,7 @@ void KeyframeAnimation::animate(CompositeAnimation* animation, RenderObject* ren ...@@ -84,7 +84,7 @@ void KeyframeAnimation::animate(CompositeAnimation* animation, RenderObject* ren
// We should cache the last pair or something. // We should cache the last pair or something.
// Find the first key // 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) if (elapsedTime < 0)
elapsedTime = 0; elapsedTime = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment