From 9b8370230363c6f1dc2f15e24a0a795f67af4a57 Mon Sep 17 00:00:00 2001 From: "pdr@google.com" Date: Tue, 26 Jun 2012 10:06:34 +0000 Subject: [PATCH] Fix setCurrentTime for paused animations https://bugs.webkit.org/show_bug.cgi?id=81350 Reviewed by Nikolas Zimmermann. Source/WebCore: SMILTimeContainer::setElapsed was not resetting the pause time, breaking setCurrentTime if the animation was paused. Test: svg/custom/animate-pause-resume.html * svg/animation/SMILTimeContainer.cpp: (WebCore::SMILTimeContainer::setElapsed): LayoutTests: This test does not use the SVG animation test framework because the framework works by pausing animations and testing animated values at fixed times (through calling setCurrentTime). Testing this patch requires that we run the animation and cannot be tested with the animation test framework. * svg/custom/animate-pause-resume-expected.txt: Added. * svg/custom/animate-pause-resume.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121246 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 15 +++++++++ .../svg/custom/animate-pause-resume-expected.txt | 1 + LayoutTests/svg/custom/animate-pause-resume.html | 37 ++++++++++++++++++++++ Source/WebCore/ChangeLog | 15 +++++++++ Source/WebCore/svg/animation/SMILTimeContainer.cpp | 6 +++- 5 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 LayoutTests/svg/custom/animate-pause-resume-expected.txt create mode 100644 LayoutTests/svg/custom/animate-pause-resume.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 1fa8f0c..a71b447 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,18 @@ +2012-06-26 Philip Rogers + + Fix setCurrentTime for paused animations + https://bugs.webkit.org/show_bug.cgi?id=81350 + + Reviewed by Nikolas Zimmermann. + + This test does not use the SVG animation test framework because the framework + works by pausing animations and testing animated values at fixed times + (through calling setCurrentTime). Testing this patch requires that we run + the animation and cannot be tested with the animation test framework. + + * svg/custom/animate-pause-resume-expected.txt: Added. + * svg/custom/animate-pause-resume.html: Added. + 2012-06-26 Tony Chang [Qt] Enable grid layout LayoutTests diff --git a/LayoutTests/svg/custom/animate-pause-resume-expected.txt b/LayoutTests/svg/custom/animate-pause-resume-expected.txt new file mode 100644 index 0000000..7ef22e9 --- /dev/null +++ b/LayoutTests/svg/custom/animate-pause-resume-expected.txt @@ -0,0 +1 @@ +PASS diff --git a/LayoutTests/svg/custom/animate-pause-resume.html b/LayoutTests/svg/custom/animate-pause-resume.html new file mode 100644 index 0000000..097c664 --- /dev/null +++ b/LayoutTests/svg/custom/animate-pause-resume.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index d5bafca..bfed34b 100755 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2012-06-26 Philip Rogers + + Fix setCurrentTime for paused animations + https://bugs.webkit.org/show_bug.cgi?id=81350 + + Reviewed by Nikolas Zimmermann. + + SMILTimeContainer::setElapsed was not resetting the pause time, breaking + setCurrentTime if the animation was paused. + + Test: svg/custom/animate-pause-resume.html + + * svg/animation/SMILTimeContainer.cpp: + (WebCore::SMILTimeContainer::setElapsed): + 2012-06-26 Csaba Osztrogonác [Qt] Unreviewed typo fix after r121144. diff --git a/Source/WebCore/svg/animation/SMILTimeContainer.cpp b/Source/WebCore/svg/animation/SMILTimeContainer.cpp index 1566533..6b15787 100644 --- a/Source/WebCore/svg/animation/SMILTimeContainer.cpp +++ b/Source/WebCore/svg/animation/SMILTimeContainer.cpp @@ -131,8 +131,12 @@ void SMILTimeContainer::setElapsed(SMILTime time) if (m_beginTime) m_timer.stop(); - m_beginTime = currentTime() - time.value(); + double now = currentTime(); + m_beginTime = now - time.value(); + m_accumulatedPauseTime = 0; + if (m_pauseTime) + m_pauseTime = now; Vector toReset; copyToVector(m_scheduledAnimations, toReset); -- 2.7.4