<!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  &lt;simon.fraser@apple.com&gt;
</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  &lt;simon.fraser@apple.com&gt;
+
</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 - &quot;webkitTransform&quot; property for &quot;box&quot; element at 0.5s saw something close to: 1,0,0,1,150,0
</span><span class="cx"> PASS - &quot;webkitTransform&quot; property for &quot;box&quot; element at 1s saw something close to: 1,0,0,1,100,0
</span><del>-PASS - &quot;webkitTransform&quot; property for &quot;box&quot; element at 2.5s saw something close to: 1,0,0,1,200,0
</del><ins>+PASS - &quot;webkitTransform&quot; property for &quot;box&quot; 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">       [&quot;move1&quot;, 0.5, &quot;box&quot;, &quot;webkitTransform&quot;, [1,0,0,1, 150,0], 20],
</span><span class="cx">       [&quot;move1&quot;, 1.0, &quot;box&quot;, &quot;webkitTransform&quot;, [1,0,0,1,100,0], 20],
</span><del>-      [&quot;move1&quot;, 2.5, &quot;box&quot;, &quot;webkitTransform&quot;, [1,0,0,1, 200,0], 20],
</del><ins>+      [&quot;move1&quot;, 2.5, &quot;box&quot;, &quot;webkitTransform&quot;, '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>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        .container {
+            height: 100px;
+            width: 500px;
+            margin: 4px;
+            border: 1px solid black;
+        }
+        .box {
+            position: relative;
+            width: 100px;
+            height: 100px;
+            background-color: green;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div class=&quot;container&quot;&gt;
+        &lt;div id=&quot;box&quot; class=&quot;mover box&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;container&quot;&gt;
+        &lt;div id=&quot;box&quot; class=&quot;slider box&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</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>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        .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); }
+        }
+    &lt;/style&gt;
+    &lt;script&gt;
+        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);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div class=&quot;container&quot;&gt;
+        &lt;div id=&quot;box1&quot; class=&quot;box&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;container&quot;&gt;
+        &lt;div id=&quot;box2&quot; class=&quot;box&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</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>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        .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; }
+        }
+    &lt;/style&gt;
+    &lt;script&gt;
+        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 = &quot;FAIL: animation restarted after changing animation-duration&quot;
+                        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);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div class=&quot;container&quot;&gt;
+        &lt;div id=&quot;box&quot; class=&quot;box&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div id=&quot;results&quot;&gt;
+        PASS: animation did not restart after changing animation-duration.
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</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  &lt;simon.fraser@apple.com&gt;
</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  &lt;simon.fraser@apple.com&gt;
+
</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 &gt; 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 &amp; Paused) &amp;&amp; inPausedState())
</span><span class="cx">             return true;
</span><span class="cx"> 
</span><del>-        if ((runningState &amp; Running) &amp;&amp; !inPausedState() &amp;&amp; (m_animationState &gt;= AnimationState::StartWaitStyleAvailable &amp;&amp; m_animationState &lt;= AnimationState::Done))
</del><ins>+        if ((runningState &amp; Running) &amp;&amp; !inPausedState() &amp;&amp; (m_animationState &gt;= AnimationState::StartWaitStyleAvailable &amp;&amp; m_animationState &lt; 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 &amp;&amp; currentStyle-&gt;hasAnimations() &amp;&amp; targetStyle-&gt;hasAnimations() &amp;&amp; *(currentStyle-&gt;animations()) == *(targetStyle-&gt;animations())) {
-        // The current and target animations are the same so we just need to toss any 
-        // animation which is finished (postActive).
-        for (auto&amp; animation : m_keyframeAnimations.values()) {
-            if (animation-&gt;postActive())
-                animation-&gt;setIndex(-1);
-        }
-    } else {
-        // Mark all existing animations as no longer active.
-        for (auto&amp; animation : m_keyframeAnimations.values())
-            animation-&gt;setIndex(-1);
</del><ins>+    if (currentStyle &amp;&amp; currentStyle-&gt;hasAnimations() &amp;&amp; targetStyle-&gt;hasAnimations() &amp;&amp; *(currentStyle-&gt;animations()) == *(targetStyle-&gt;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&lt;const AtomicString&gt; none(&quot;none&quot;, AtomicString::ConstructFromLiteral);
-        
-        // Now mark any still active animations as active and add any new animations.
-        if (targetStyle-&gt;animations()) {
-            int numAnims = targetStyle-&gt;animations()-&gt;size();
-            for (int i = 0; i &lt; numAnims; ++i) {
-                Animation&amp; animation = targetStyle-&gt;animations()-&gt;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&lt;const AtomicString&gt; none(&quot;none&quot;, AtomicString::ConstructFromLiteral);
+    
+    // Now mark any still active animations as active and add any new animations.
+    if (targetStyle-&gt;animations()) {
+        int numAnims = targetStyle-&gt;animations()-&gt;size();
+        for (int i = 0; i &lt; numAnims; ++i) {
+            Animation&amp; animation = targetStyle-&gt;animations()-&gt;animation(i);
+            AtomicString animationName(animation.name());
+
+            if (!animation.isValidAnimation())
+                continue;
+            
+            // See if there is a current animation for this name.
+            RefPtr&lt;KeyframeAnimation&gt; keyframeAnim = m_keyframeAnimations.get(animationName.impl());
+            if (keyframeAnim) {
+                newAnimations.add(keyframeAnim-&gt;name().impl(), keyframeAnim);
+
+                if (keyframeAnim-&gt;postActive())
</ins><span class="cx">                     continue;
</span><del>-                
-                // See if there is a current animation for this name.
-                RefPtr&lt;KeyframeAnimation&gt; 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-&gt;postActive())
-                        continue;
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><del>-                    if (animation.trigger()-&gt;isScrollAnimationTrigger())
-                        m_hasScrollTriggeredAnimation = true;
</del><ins>+                if (animation.trigger()-&gt;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-&gt;updatePlayState(animation.playState());
</ins><span class="cx"> 
</span><del>-                    // Animations match, but play states may differ. Update if needed.
-                    keyframeAnim-&gt;updatePlayState(animation.playState());
-                                
-                    // Set the saved animation to this new one, just in case the play state has changed.
-                    keyframeAnim-&gt;setAnimation(animation);
-                    keyframeAnim-&gt;setIndex(i);
-                } else if ((animation.duration() || animation.delay()) &amp;&amp; animation.iterationCount() &amp;&amp; animationName != none) {
-                    keyframeAnim = KeyframeAnimation::create(animation, renderer, i, this, targetStyle);
-                    LOG(Animations, &quot;Creating KeyframeAnimation %p on renderer %p with keyframes %s, duration %.2f, delay %.2f, iterations %.2f&quot;, keyframeAnim.get(), renderer, animation.name().utf8().data(), animation.duration(), animation.delay(), animation.iterationCount());
-                    if (m_suspended) {
-                        keyframeAnim-&gt;updatePlayState(AnimPlayStatePaused);
-                        LOG(Animations, &quot;  (created in suspended/paused state)&quot;);
-                    }
</del><ins>+                // Set the saved animation to this new one, just in case the play state has changed.
+                keyframeAnim-&gt;setAnimation(animation);
+            } else if ((animation.duration() || animation.delay()) &amp;&amp; animation.iterationCount() &amp;&amp; animationName != none) {
+                keyframeAnim = KeyframeAnimation::create(animation, renderer, this, targetStyle);
+                LOG(Animations, &quot;Creating KeyframeAnimation %p on renderer %p with keyframes %s, duration %.2f, delay %.2f, iterations %.2f&quot;, keyframeAnim.get(), renderer, animation.name().utf8().data(), animation.duration(), animation.delay(), animation.iterationCount());
+
+                if (m_suspended) {
+                    keyframeAnim-&gt;updatePlayState(AnimPlayStatePaused);
+                    LOG(Animations, &quot;  (created in suspended/paused state)&quot;);
+                }
</ins><span class="cx"> #if !LOG_DISABLED
</span><del>-                    for (auto propertyID : keyframeAnim-&gt;keyframes().properties())
-                        LOG(Animations, &quot;  property %s&quot;, getPropertyName(propertyID));
</del><ins>+                for (auto propertyID : keyframeAnim-&gt;keyframes().properties())
+                    LOG(Animations, &quot;  property %s&quot;, 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()-&gt;isScrollAnimationTrigger())
-                        m_hasScrollTriggeredAnimation = true;
</del><ins>+                if (animation.trigger()-&gt;isScrollAnimationTrigger())
+                    m_hasScrollTriggeredAnimation = true;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-                    m_keyframeAnimations.set(keyframeAnim-&gt;name().impl(), keyframeAnim);
-                }
-                
-                // Add this to the animation order map.
-                if (keyframeAnim)
-                    m_keyframeAnimationOrderMap.append(keyframeAnim-&gt;name().impl());
</del><ins>+                newAnimations.set(keyframeAnim-&gt;name().impl(), keyframeAnim);
</ins><span class="cx">             }
</span><ins>+            
+            // Add this to the animation order map.
+            if (keyframeAnim)
+                m_keyframeAnimationOrderMap.append(keyframeAnim-&gt;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&lt;AtomicStringImpl*&gt; animsToBeRemoved;
</del><span class="cx">     for (auto&amp; animation : m_keyframeAnimations.values()) {
</span><del>-        if (animation-&gt;index() &lt; 0) {
-            animsToBeRemoved.append(animation-&gt;name().impl());
</del><ins>+        if (!newAnimations.contains(animation-&gt;name().impl())) {
</ins><span class="cx">             animationController().animationWillBeRemoved(animation.get());
</span><span class="cx">             animation-&gt;clear();
</span><span class="cx">             LOG(Animations, &quot;Removing KeyframeAnimation %p from renderer %p&quot;, 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&amp; renderer, RenderStyle* currentStyle, RenderStyle&amp; targetStyle, Ref&lt;RenderStyle&gt;&amp; 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&amp; animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
</del><ins>+KeyframeAnimation::KeyframeAnimation(Animation&amp; 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 &amp;&amp; m_object-&gt;element())
</span><span class="lines">@@ -190,9 +189,8 @@
</span><span class="cx"> 
</span><span class="cx"> void KeyframeAnimation::getAnimatedStyle(RefPtr&lt;RenderStyle&gt;&amp; 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() &amp;&amp; m_animation-&gt;delay() &gt; 0 &amp;&amp; !m_animation-&gt;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() &amp;&amp; m_animation-&gt;delay() &gt; 0 &amp;&amp; !m_animation-&gt;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&lt;KeyframeAnimation&gt; create(Animation&amp; animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
</del><ins>+    static Ref&lt;KeyframeAnimation&gt; create(Animation&amp; 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&lt;RenderStyle&gt;&amp; animatedStyle) override;
</span><span class="lines">@@ -53,8 +53,6 @@
</span><span class="cx">     const KeyframeList&amp; keyframes() const { return m_keyframes; }
</span><span class="cx"> 
</span><span class="cx">     const AtomicString&amp; 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&amp;, RenderElement*, int index, CompositeAnimation*, RenderStyle* unanimatedStyle);
</del><ins>+    KeyframeAnimation(Animation&amp;, 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&lt;RenderStyle&gt; 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>