[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
cmarrin at apple.com
cmarrin at apple.com
Wed Dec 22 14:58:29 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit bf337fe44f0d71f38dae0736322c363a137bc0db
Author: cmarrin at apple.com <cmarrin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 26 19:11:58 2010 +0000
2010-10-26 Chris Marrin <cmarrin at apple.com>
Reviewed by Simon Fraser.
Resuming animations causes webkitAnimationStart events to be fired
https://bugs.webkit.org/show_bug.cgi?id=46540
Added a flag that makes sure start animation event is only ever
fired once.
Test: animations/suspend-resume-animation-events.html
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::sendAnimationEvent):
* page/animation/KeyframeAnimation.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 99a6c20..7ce35d6 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-26 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Resuming animations causes webkitAnimationStart events to be fired
+ https://bugs.webkit.org/show_bug.cgi?id=46540
+
+ Test case which generated event logs to make sure start animation
+ event not generatd a second time after resume.
+
+ * animations/suspend-resume-animation-events-expected.txt: Added.
+ * animations/suspend-resume-animation-events.html: Added.
+
2010-10-26 Martin Robinson <mrobinson at igalia.com>
Add baselines for some GTK+ tests, unskip passing tests and organize
diff --git a/LayoutTests/animations/suspend-resume-animation-events-expected.txt b/LayoutTests/animations/suspend-resume-animation-events-expected.txt
new file mode 100644
index 0000000..1b73efa
--- /dev/null
+++ b/LayoutTests/animations/suspend-resume-animation-events-expected.txt
@@ -0,0 +1,8 @@
+Events generated are displayed. There should be one start event one iteration event and one end event. There should not be a start event generated when the animation is resumed.
+
+Log
+
+start animation move
+iteration animation move
+end animation move
+
diff --git a/LayoutTests/animations/suspend-resume-animation-events.html b/LayoutTests/animations/suspend-resume-animation-events.html
new file mode 100644
index 0000000..11a9399
--- /dev/null
+++ b/LayoutTests/animations/suspend-resume-animation-events.html
@@ -0,0 +1,82 @@
+<!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">
+ <title>Test event generation with suspendAnimations()/resumeAnimations() for animations</title>
+ <style type="text/css" media="screen">
+ #box {
+ position: relative;
+ height: 100px;
+ width: 100px;
+ background-color: blue;
+ -webkit-animation-duration: 0.1s;
+ -webkit-animation-timing-function: linear;
+ -webkit-animation-direction: alternate;
+ -webkit-animation-iteration-count: 2;
+ -webkit-animation-name: "move";
+ }
+ @-webkit-keyframes "move" {
+ from { left: 0; }
+ to { left: 500px; }
+ }
+ #log {
+ margin-top: 20px;
+ height: 300px;
+ width: 500px;
+ border: 2px solid gray;
+ }
+ </style>
+ <script type="text/javascript" charset="utf-8">
+
+ function suspend()
+ {
+ if (window.layoutTestController)
+ layoutTestController.suspendAnimations();
+ }
+
+ function resume()
+ {
+ if (window.layoutTestController)
+ layoutTestController.resumeAnimations();
+ }
+
+ function startTest()
+ {
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ setTimeout(suspend, 40);
+ setTimeout(resume, 100);
+ setTimeout(function()
+ {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }, 350);
+ }
+
+ function logEvent(e, phase)
+ {
+ var log = document.getElementById('log');
+ log.innerHTML = log.innerHTML + phase + ' animation ' + e.animationName + '<br>';
+ }
+
+
+ </script>
+</head>
+<body onload="startTest()">
+<p>
+Events generated are displayed. There should be one start event one iteration event and one end event. There
+should not be a start event generated when the animation is resumed.
+<div id="box"
+ onwebkitanimationstart="logEvent(event, 'start'); return false;"
+ onwebkitanimationiteration="logEvent(event, 'iteration'); return false;"
+ onwebkitanimationend="logEvent(event, 'end'); return false;"
+>
+</div>
+<p>Log</p>
+<div id="log">
+</div>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ea93a22..a404250 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-10-26 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Resuming animations causes webkitAnimationStart events to be fired
+ https://bugs.webkit.org/show_bug.cgi?id=46540
+
+ Added a flag that makes sure start animation event is only ever
+ fired once.
+
+ Test: animations/suspend-resume-animation-events.html
+
+ * page/animation/KeyframeAnimation.cpp:
+ (WebCore::KeyframeAnimation::KeyframeAnimation):
+ (WebCore::KeyframeAnimation::sendAnimationEvent):
+ * page/animation/KeyframeAnimation.h:
+
2010-10-26 Abhishek Arya <inferno at chromium.org>
Reviewed by Dimitri Glazkov.
diff --git a/WebCore/page/animation/KeyframeAnimation.cpp b/WebCore/page/animation/KeyframeAnimation.cpp
index df963fb..84d6b97 100644
--- a/WebCore/page/animation/KeyframeAnimation.cpp
+++ b/WebCore/page/animation/KeyframeAnimation.cpp
@@ -47,6 +47,7 @@ KeyframeAnimation::KeyframeAnimation(const Animation* animation, RenderObject* r
: AnimationBase(animation, renderer, compAnim)
, m_keyframes(renderer, animation->name())
, m_index(index)
+ , m_startEventDispatched(false)
, m_unanimatedStyle(unanimatedStyle)
{
// Get the keyframe RenderStyles
@@ -323,6 +324,9 @@ bool KeyframeAnimation::sendAnimationEvent(const AtomicString& eventType, double
listenerType = Document::ANIMATIONEND_LISTENER;
else {
ASSERT(eventType == eventNames().webkitAnimationStartEvent);
+ if (m_startEventDispatched)
+ return false;
+ m_startEventDispatched = true;
listenerType = Document::ANIMATIONSTART_LISTENER;
}
diff --git a/WebCore/page/animation/KeyframeAnimation.h b/WebCore/page/animation/KeyframeAnimation.h
index a187f35..5099b50 100644
--- a/WebCore/page/animation/KeyframeAnimation.h
+++ b/WebCore/page/animation/KeyframeAnimation.h
@@ -90,6 +90,7 @@ private:
// The order in which this animation appears in the animation-name style.
int m_index;
+ bool m_startEventDispatched;
// The style just before we started animation
RefPtr<RenderStyle> m_unanimatedStyle;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list