<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[200836] releases/WebKitGTK/webkit-2.12</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/200836">200836</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-05-13 04:02:27 -0700 (Fri, 13 May 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/200047">r200047</a> - Toggling animation-play-state can re-start a finished animation
https://bugs.webkit.org/show_bug.cgi?id=156731
Reviewed by Dean Jackson.
Source/WebCore:
After an animation completed, CompositeAnimation::updateKeyframeAnimations() cleared
all state that the animation had run on the element, so changing the value of some
animation property triggered the animation to run again. This is wrong, since animation-name
still applied to the element.
Fix by keeping state for keyframe animations in the Done state in the m_keyframeAnimations
map. This allows for the removal of the index property on KeyframeAnimation.
Tests: animations/change-completed-animation-transform.html
animations/change-completed-animation.html
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::timeToNextService):
* page/animation/AnimationBase.h:
(WebCore::AnimationBase::isAnimatingProperty):
* page/animation/CompositeAnimation.cpp: Add animations that should stick around to AnimationNameMap,
and swap with m_keyframeAnimations at the end.
(WebCore::CompositeAnimation::updateKeyframeAnimations):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::getAnimatedStyle):
* page/animation/KeyframeAnimation.h:
LayoutTests:
* animations/animation-direction-reverse-expected.txt:
* animations/animation-direction-reverse.html: This is a progression. The test was detecting a
restarted animation.
* animations/change-completed-animation-expected.txt: Added.
* animations/change-completed-animation-transform-expected.html: Added.
* animations/change-completed-animation-transform.html: Added. Ref test that ensures that the final
state for normal and accelerated animations is correct.
* animations/change-completed-animation.html: Added. Tests that changing a property doesn't trigger
another animation, by detecting a second animationstart event.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsanimationsanimationdirectionreverseexpectedtxt">releases/WebKitGTK/webkit-2.12/LayoutTests/animations/animation-direction-reverse-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsanimationsanimationdirectionreversehtml">releases/WebKitGTK/webkit-2.12/LayoutTests/animations/animation-direction-reverse.html</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCorepageanimationAnimationBasecpp">releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/AnimationBase.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCorepageanimationAnimationBaseh">releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/AnimationBase.h</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCorepageanimationCompositeAnimationcpp">releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/CompositeAnimation.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCorepageanimationKeyframeAnimationcpp">releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/KeyframeAnimation.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCorepageanimationKeyframeAnimationh">releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/KeyframeAnimation.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsanimationschangecompletedanimationexpectedtxt">releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsanimationschangecompletedanimationtransformexpectedhtml">releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation-transform-expected.html</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsanimationschangecompletedanimationtransformhtml">releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation-transform.html</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsanimationschangecompletedanimationhtml">releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit212LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (200835 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog        2016-05-13 11:01:53 UTC (rev 200835)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2016-04-25 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><ins>+ Toggling animation-play-state can re-start a finished animation
+ https://bugs.webkit.org/show_bug.cgi?id=156731
+
+ Reviewed by Dean Jackson.
+
+ * animations/animation-direction-reverse-expected.txt:
+ * animations/animation-direction-reverse.html: This is a progression. The test was detecting a
+ restarted animation.
+ * animations/change-completed-animation-expected.txt: Added.
+ * animations/change-completed-animation-transform-expected.html: Added.
+ * animations/change-completed-animation-transform.html: Added. Ref test that ensures that the final
+ state for normal and accelerated animations is correct.
+ * animations/change-completed-animation.html: Added. Tests that changing a property doesn't trigger
+ another animation, by detecting a second animationstart event.
+
+2016-04-25 Simon Fraser <simon.fraser@apple.com>
+
</ins><span class="cx"> play-state not parsed as part of animation shorthand
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=156959
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsanimationsanimationdirectionreverseexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/animations/animation-direction-reverse-expected.txt (200835 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/animations/animation-direction-reverse-expected.txt        2016-05-13 11:01:53 UTC (rev 200835)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/animations/animation-direction-reverse-expected.txt        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><span class="cx"> PASS - "webkitTransform" property for "box" element at 0.5s saw something close to: 1,0,0,1,150,0
</span><span class="cx"> PASS - "webkitTransform" property for "box" element at 1s saw something close to: 1,0,0,1,100,0
</span><del>-PASS - "webkitTransform" property for "box" element at 2.5s saw something close to: 1,0,0,1,200,0
</del><ins>+PASS - "webkitTransform" property for "box" element at 2.5s saw something close to: none
</ins><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsanimationsanimationdirectionreversehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/animations/animation-direction-reverse.html (200835 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/animations/animation-direction-reverse.html        2016-05-13 11:01:53 UTC (rev 200835)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/animations/animation-direction-reverse.html        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> // [animation-name, time, element-id, property, expected-value, tolerance]
</span><span class="cx"> ["move1", 0.5, "box", "webkitTransform", [1,0,0,1, 150,0], 20],
</span><span class="cx"> ["move1", 1.0, "box", "webkitTransform", [1,0,0,1,100,0], 20],
</span><del>- ["move1", 2.5, "box", "webkitTransform", [1,0,0,1, 200,0], 20],
</del><ins>+ ["move1", 2.5, "box", "webkitTransform", 'none', 20],
</ins><span class="cx"> ];
</span><span class="cx">
</span><span class="cx"> function pauseAnimation()
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsanimationschangecompletedanimationexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation-expected.txt (0 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation-expected.txt         (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation-expected.txt        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS: animation did not restart after changing animation-duration.
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsanimationschangecompletedanimationtransformexpectedhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation-transform-expected.html (0 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation-transform-expected.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation-transform-expected.html        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ .container {
+ height: 100px;
+ width: 500px;
+ margin: 4px;
+ border: 1px solid black;
+ }
+ .box {
+ position: relative;
+ width: 100px;
+ height: 100px;
+ background-color: green;
+ }
+ </style>
+</head>
+<body>
+ <div class="container">
+ <div id="box" class="mover box"></div>
+ </div>
+ <div class="container">
+ <div id="box" class="slider box"></div>
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsanimationschangecompletedanimationtransformhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation-transform.html (0 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation-transform.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation-transform.html        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ .container {
+ height: 100px;
+ width: 500px;
+ margin: 4px;
+ border: 1px solid black;
+ }
+ .box {
+ position: relative;
+ width: 100px;
+ height: 100px;
+ background-color: green;
+ }
+
+ .mover {
+ animation: move 0.25s linear;
+ }
+
+ body.changed .mover {
+ animation-duration: 0.2s;
+ }
+
+ .slider {
+ animation: slide 0.25s linear;
+ }
+
+ body.changed .slider {
+ animation-duration: 0.2s;
+ }
+
+ @keyframes move {
+ from { left: 100px; }
+ to { left: 400px; }
+ }
+
+ @keyframes slide {
+ from { transform: translateX(100px); }
+ to { transform: translateX(400px); }
+ }
+ </style>
+ <script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ function doTest()
+ {
+ var box = document.getElementById('box1');
+ box.addEventListener('animationend', function() {
+ window.setTimeout(function() {
+ document.body.classList.add('changed');
+ window.setTimeout(function() {
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 10);
+ }, 0);
+ }, false);
+
+ box.classList.add('mover');
+ document.getElementById('box2').classList.add('slider');
+ }
+
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+ <div class="container">
+ <div id="box1" class="box"></div>
+ </div>
+ <div class="container">
+ <div id="box2" class="box"></div>
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsanimationschangecompletedanimationhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation.html (0 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/animations/change-completed-animation.html        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ .container {
+ height: 100px;
+ width: 500px;
+ margin: 4px;
+ border: 1px solid black;
+ }
+ .box {
+ position: relative;
+ width: 100px;
+ height: 100px;
+ background-color: green;
+ }
+
+ .mover {
+ animation: move 0.25s linear;
+ }
+
+ .mover.changed {
+ animation-duration: 0.2s;
+ }
+
+ @keyframes move {
+ from { left: 100px; }
+ to { left: 400px; }
+ }
+ </style>
+ <script>
+ if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+ }
+
+ function doTest()
+ {
+ var box = document.getElementById('box');
+ box.addEventListener('animationend', function() {
+ window.setTimeout(function() {
+ box.addEventListener('animationstart', function() {
+ document.getElementById('results').textContent = "FAIL: animation restarted after changing animation-duration"
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, false);
+
+ // In the success case, wait a bit to make sure no animationstart event comes in.
+ window.setTimeout(function() {
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 50);
+
+ box.classList.add('changed');
+ }, 0);
+ }, false);
+
+ box.classList.add('mover');
+ }
+
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+ <div class="container">
+ <div id="box" class="box"></div>
+ </div>
+ <div id="results">
+ PASS: animation did not restart after changing animation-duration.
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (200835 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog        2016-05-13 11:01:53 UTC (rev 200835)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -1,5 +1,35 @@
</span><span class="cx"> 2016-04-25 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><ins>+ Toggling animation-play-state can re-start a finished animation
+ https://bugs.webkit.org/show_bug.cgi?id=156731
+
+ Reviewed by Dean Jackson.
+
+ After an animation completed, CompositeAnimation::updateKeyframeAnimations() cleared
+ all state that the animation had run on the element, so changing the value of some
+ animation property triggered the animation to run again. This is wrong, since animation-name
+ still applied to the element.
+
+ Fix by keeping state for keyframe animations in the Done state in the m_keyframeAnimations
+ map. This allows for the removal of the index property on KeyframeAnimation.
+
+ Tests: animations/change-completed-animation-transform.html
+ animations/change-completed-animation.html
+
+ * page/animation/AnimationBase.cpp:
+ (WebCore::AnimationBase::timeToNextService):
+ * page/animation/AnimationBase.h:
+ (WebCore::AnimationBase::isAnimatingProperty):
+ * page/animation/CompositeAnimation.cpp: Add animations that should stick around to AnimationNameMap,
+ and swap with m_keyframeAnimations at the end.
+ (WebCore::CompositeAnimation::updateKeyframeAnimations):
+ * page/animation/KeyframeAnimation.cpp:
+ (WebCore::KeyframeAnimation::KeyframeAnimation):
+ (WebCore::KeyframeAnimation::getAnimatedStyle):
+ * page/animation/KeyframeAnimation.h:
+
+2016-04-25 Simon Fraser <simon.fraser@apple.com>
+
</ins><span class="cx"> play-state not parsed as part of animation shorthand
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=156959
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCorepageanimationAnimationBasecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/AnimationBase.cpp (200835 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/AnimationBase.cpp        2016-05-13 11:01:53 UTC (rev 200835)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/AnimationBase.cpp        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -560,7 +560,7 @@
</span><span class="cx"> {
</span><span class="cx"> // Returns the time at which next service is required. -1 means no service is required. 0 means
</span><span class="cx"> // service is required now, and > 0 means service is required that many seconds in the future.
</span><del>- if (paused() || isNew() || m_animationState == AnimationState::FillingForwards)
</del><ins>+ if (paused() || isNew() || postActive() || fillingForwards())
</ins><span class="cx"> return -1;
</span><span class="cx">
</span><span class="cx"> if (m_animationState == AnimationState::StartWaitTimer) {
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCorepageanimationAnimationBaseh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/AnimationBase.h (200835 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/AnimationBase.h        2016-05-13 11:01:53 UTC (rev 200835)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/AnimationBase.h        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -181,7 +181,7 @@
</span><span class="cx"> if ((runningState & Paused) && inPausedState())
</span><span class="cx"> return true;
</span><span class="cx">
</span><del>- if ((runningState & Running) && !inPausedState() && (m_animationState >= AnimationState::StartWaitStyleAvailable && m_animationState <= AnimationState::Done))
</del><ins>+ if ((runningState & Running) && !inPausedState() && (m_animationState >= AnimationState::StartWaitStyleAvailable && m_animationState < AnimationState::Done))
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> return false;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCorepageanimationCompositeAnimationcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/CompositeAnimation.cpp (200835 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/CompositeAnimation.cpp        2016-05-13 11:01:53 UTC (rev 200835)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/CompositeAnimation.cpp        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -203,99 +203,85 @@
</span><span class="cx">
</span><span class="cx"> m_keyframeAnimations.checkConsistency();
</span><span class="cx">
</span><del>- if (currentStyle && currentStyle->hasAnimations() && targetStyle->hasAnimations() && *(currentStyle->animations()) == *(targetStyle->animations())) {
- // The current and target animations are the same so we just need to toss any
- // animation which is finished (postActive).
- for (auto& animation : m_keyframeAnimations.values()) {
- if (animation->postActive())
- animation->setIndex(-1);
- }
- } else {
- // Mark all existing animations as no longer active.
- for (auto& animation : m_keyframeAnimations.values())
- animation->setIndex(-1);
</del><ins>+ if (currentStyle && currentStyle->hasAnimations() && targetStyle->hasAnimations() && *(currentStyle->animations()) == *(targetStyle->animations()))
+ return;
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><del>- m_hasScrollTriggeredAnimation = false;
</del><ins>+ m_hasScrollTriggeredAnimation = false;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- // Toss the animation order map.
- m_keyframeAnimationOrderMap.clear();
</del><ins>+ AnimationNameMap newAnimations;
</ins><span class="cx">
</span><del>- static NeverDestroyed<const AtomicString> none("none", AtomicString::ConstructFromLiteral);
-
- // Now mark any still active animations as active and add any new animations.
- if (targetStyle->animations()) {
- int numAnims = targetStyle->animations()->size();
- for (int i = 0; i < numAnims; ++i) {
- Animation& animation = targetStyle->animations()->animation(i);
- AtomicString animationName(animation.name());
</del><ins>+ // Toss the animation order map.
+ m_keyframeAnimationOrderMap.clear();
</ins><span class="cx">
</span><del>- if (!animation.isValidAnimation())
</del><ins>+ static NeverDestroyed<const AtomicString> none("none", AtomicString::ConstructFromLiteral);
+
+ // Now mark any still active animations as active and add any new animations.
+ if (targetStyle->animations()) {
+ int numAnims = targetStyle->animations()->size();
+ for (int i = 0; i < numAnims; ++i) {
+ Animation& animation = targetStyle->animations()->animation(i);
+ AtomicString animationName(animation.name());
+
+ if (!animation.isValidAnimation())
+ continue;
+
+ // See if there is a current animation for this name.
+ RefPtr<KeyframeAnimation> keyframeAnim = m_keyframeAnimations.get(animationName.impl());
+ if (keyframeAnim) {
+ newAnimations.add(keyframeAnim->name().impl(), keyframeAnim);
+
+ if (keyframeAnim->postActive())
</ins><span class="cx"> continue;
</span><del>-
- // See if there is a current animation for this name.
- RefPtr<KeyframeAnimation> keyframeAnim = m_keyframeAnimations.get(animationName.impl());
-
- if (keyframeAnim) {
- // If this animation is postActive, skip it so it gets removed at the end of this function.
- if (keyframeAnim->postActive())
- continue;
</del><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><del>- if (animation.trigger()->isScrollAnimationTrigger())
- m_hasScrollTriggeredAnimation = true;
</del><ins>+ if (animation.trigger()->isScrollAnimationTrigger())
+ m_hasScrollTriggeredAnimation = true;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- // This one is still active.
</del><ins>+ // Animations match, but play states may differ. Update if needed.
+ keyframeAnim->updatePlayState(animation.playState());
</ins><span class="cx">
</span><del>- // Animations match, but play states may differ. Update if needed.
- keyframeAnim->updatePlayState(animation.playState());
-
- // Set the saved animation to this new one, just in case the play state has changed.
- keyframeAnim->setAnimation(animation);
- keyframeAnim->setIndex(i);
- } else if ((animation.duration() || animation.delay()) && animation.iterationCount() && animationName != none) {
- keyframeAnim = KeyframeAnimation::create(animation, renderer, i, this, targetStyle);
- LOG(Animations, "Creating KeyframeAnimation %p on renderer %p with keyframes %s, duration %.2f, delay %.2f, iterations %.2f", keyframeAnim.get(), renderer, animation.name().utf8().data(), animation.duration(), animation.delay(), animation.iterationCount());
- if (m_suspended) {
- keyframeAnim->updatePlayState(AnimPlayStatePaused);
- LOG(Animations, " (created in suspended/paused state)");
- }
</del><ins>+ // Set the saved animation to this new one, just in case the play state has changed.
+ keyframeAnim->setAnimation(animation);
+ } else if ((animation.duration() || animation.delay()) && animation.iterationCount() && animationName != none) {
+ keyframeAnim = KeyframeAnimation::create(animation, renderer, this, targetStyle);
+ LOG(Animations, "Creating KeyframeAnimation %p on renderer %p with keyframes %s, duration %.2f, delay %.2f, iterations %.2f", keyframeAnim.get(), renderer, animation.name().utf8().data(), animation.duration(), animation.delay(), animation.iterationCount());
+
+ if (m_suspended) {
+ keyframeAnim->updatePlayState(AnimPlayStatePaused);
+ LOG(Animations, " (created in suspended/paused state)");
+ }
</ins><span class="cx"> #if !LOG_DISABLED
</span><del>- for (auto propertyID : keyframeAnim->keyframes().properties())
- LOG(Animations, " property %s", getPropertyName(propertyID));
</del><ins>+ for (auto propertyID : keyframeAnim->keyframes().properties())
+ LOG(Animations, " property %s", getPropertyName(propertyID));
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><del>- if (animation.trigger()->isScrollAnimationTrigger())
- m_hasScrollTriggeredAnimation = true;
</del><ins>+ if (animation.trigger()->isScrollAnimationTrigger())
+ m_hasScrollTriggeredAnimation = true;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- m_keyframeAnimations.set(keyframeAnim->name().impl(), keyframeAnim);
- }
-
- // Add this to the animation order map.
- if (keyframeAnim)
- m_keyframeAnimationOrderMap.append(keyframeAnim->name().impl());
</del><ins>+ newAnimations.set(keyframeAnim->name().impl(), keyframeAnim);
</ins><span class="cx"> }
</span><ins>+
+ // Add this to the animation order map.
+ if (keyframeAnim)
+ m_keyframeAnimationOrderMap.append(keyframeAnim->name().impl());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Make a list of animations to be removed.
</span><del>- Vector<AtomicStringImpl*> animsToBeRemoved;
</del><span class="cx"> for (auto& animation : m_keyframeAnimations.values()) {
</span><del>- if (animation->index() < 0) {
- animsToBeRemoved.append(animation->name().impl());
</del><ins>+ if (!newAnimations.contains(animation->name().impl())) {
</ins><span class="cx"> animationController().animationWillBeRemoved(animation.get());
</span><span class="cx"> animation->clear();
</span><span class="cx"> LOG(Animations, "Removing KeyframeAnimation %p from renderer %p", animation.get(), renderer);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // Now remove the animations from the list.
- for (auto* nameForRemoval : animsToBeRemoved)
- m_keyframeAnimations.remove(nameForRemoval);
</del><ins>+ std::swap(newAnimations, m_keyframeAnimations);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool CompositeAnimation::animate(RenderElement& renderer, RenderStyle* currentStyle, RenderStyle& targetStyle, Ref<RenderStyle>& blendedStyle)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCorepageanimationKeyframeAnimationcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/KeyframeAnimation.cpp (200835 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/KeyframeAnimation.cpp        2016-05-13 11:01:53 UTC (rev 200835)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/KeyframeAnimation.cpp        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -41,11 +41,10 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-KeyframeAnimation::KeyframeAnimation(Animation& animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
</del><ins>+KeyframeAnimation::KeyframeAnimation(Animation& animation, RenderElement* renderer, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
</ins><span class="cx"> : AnimationBase(animation, renderer, compositeAnimation)
</span><span class="cx"> , m_keyframes(animation.name())
</span><span class="cx"> , m_unanimatedStyle(unanimatedStyle)
</span><del>- , m_index(index)
</del><span class="cx"> {
</span><span class="cx"> // Get the keyframe RenderStyles
</span><span class="cx"> if (m_object && m_object->element())
</span><span class="lines">@@ -190,9 +189,8 @@
</span><span class="cx">
</span><span class="cx"> void KeyframeAnimation::getAnimatedStyle(RefPtr<RenderStyle>& animatedStyle)
</span><span class="cx"> {
</span><del>- // If we're in the delay phase and we're not backwards filling, tell the caller
- // to use the current style.
- if (waitingToStart() && m_animation->delay() > 0 && !m_animation->fillsBackwards())
</del><ins>+ // If we're done, or in the delay phase and we're not backwards filling, tell the caller to use the current style.
+ if (postActive() || (waitingToStart() && m_animation->delay() > 0 && !m_animation->fillsBackwards()))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (!m_keyframes.size())
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCorepageanimationKeyframeAnimationh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/KeyframeAnimation.h (200835 => 200836)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/KeyframeAnimation.h        2016-05-13 11:01:53 UTC (rev 200835)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/page/animation/KeyframeAnimation.h        2016-05-13 11:02:27 UTC (rev 200836)
</span><span class="lines">@@ -40,9 +40,9 @@
</span><span class="cx"> // A KeyframeAnimation tracks the state of an explicit animation for a single RenderElement.
</span><span class="cx"> class KeyframeAnimation final : public AnimationBase {
</span><span class="cx"> public:
</span><del>- static Ref<KeyframeAnimation> create(Animation& animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
</del><ins>+ static Ref<KeyframeAnimation> create(Animation& animation, RenderElement* renderer, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
</ins><span class="cx"> {
</span><del>- return adoptRef(*new KeyframeAnimation(animation, renderer, index, compositeAnimation, unanimatedStyle));
</del><ins>+ return adoptRef(*new KeyframeAnimation(animation, renderer, compositeAnimation, unanimatedStyle));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* currentStyle, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle) override;
</span><span class="lines">@@ -53,8 +53,6 @@
</span><span class="cx"> const KeyframeList& keyframes() const { return m_keyframes; }
</span><span class="cx">
</span><span class="cx"> const AtomicString& name() const { return m_keyframes.animationName(); }
</span><del>- int index() const { return m_index; }
- void setIndex(int i) { m_index = i; }
</del><span class="cx">
</span><span class="cx"> bool hasAnimationForProperty(CSSPropertyID) const;
</span><span class="cx">
</span><span class="lines">@@ -90,7 +88,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- KeyframeAnimation(Animation&, RenderElement*, int index, CompositeAnimation*, RenderStyle* unanimatedStyle);
</del><ins>+ KeyframeAnimation(Animation&, RenderElement*, CompositeAnimation*, RenderStyle* unanimatedStyle);
</ins><span class="cx"> virtual ~KeyframeAnimation();
</span><span class="cx">
</span><span class="cx"> // Get the styles for the given property surrounding the current animation time and the progress between them.
</span><span class="lines">@@ -99,7 +97,6 @@
</span><span class="cx"> KeyframeList m_keyframes;
</span><span class="cx"> RefPtr<RenderStyle> m_unanimatedStyle; // The style just before we started animation
</span><span class="cx">
</span><del>- int m_index; // The order in which this animation appears in the animation-name style.
</del><span class="cx"> bool m_startEventDispatched { false };
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>