<!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>[44696] trunk</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/44696">44696</a></dd>
<dt>Author</dt> <dd>cmarrin@apple.com</dd>
<dt>Date</dt> <dd>2009-06-15 15:21:54 -0700 (Mon, 15 Jun 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>        Reviewed by Simon Fraser  &lt;simon.fraser@apple.com&gt;.

        https://bugs.webkit.org/show_bug.cgi?id=26163

        Added logic to updateTransitions similar to that in updateKeyframeAnimations
        which detects and removes stale transitions.

        Test: transitions/cancel-transition.html

        * page/animation/CompositeAnimation.cpp:
        (WebCore::CompositeAnimation::updateTransitions):
        * page/animation/ImplicitAnimation.cpp:
        (WebCore::ImplicitAnimation::ImplicitAnimation):
        * page/animation/ImplicitAnimation.h:
        (WebCore::ImplicitAnimation::active):
        (WebCore::ImplicitAnimation::setActive):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorepageanimationCompositeAnimationcpp">trunk/WebCore/page/animation/CompositeAnimation.cpp</a></li>
<li><a href="#trunkWebCorepageanimationImplicitAnimationcpp">trunk/WebCore/page/animation/ImplicitAnimation.cpp</a></li>
<li><a href="#trunkWebCorepageanimationImplicitAnimationh">trunk/WebCore/page/animation/ImplicitAnimation.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTeststransitionscanceltransitionexpectedtxt">trunk/LayoutTests/transitions/cancel-transition-expected.txt</a></li>
<li><a href="#trunkLayoutTeststransitionscanceltransitionhtml">trunk/LayoutTests/transitions/cancel-transition.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (44695 => 44696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2009-06-15 21:18:17 UTC (rev 44695)
+++ trunk/LayoutTests/ChangeLog        2009-06-15 22:21:54 UTC (rev 44696)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2009-06-15  Chris Marrin  &lt;cmarrin@apple.com&gt;
+
+        Reviewed by Simon Fraser  &lt;simon.fraser@apple.com&gt;.
+
+        https://bugs.webkit.org/show_bug.cgi?id=26163
+
+        Testcase to detect transitions that are still running after removal
+
+        * transitions/cancel-transition-expected.txt: Added.
+        * transitions/cancel-transition.html: Added.
+
</ins><span class="cx"> 2009-06-15  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Tim Hatcher.
</span></span></pre></div>
<a id="trunkLayoutTeststransitionscanceltransitionexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/transitions/cancel-transition-expected.txt (0 => 44696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/transitions/cancel-transition-expected.txt                                (rev 0)
+++ trunk/LayoutTests/transitions/cancel-transition-expected.txt        2009-06-15 22:21:54 UTC (rev 44696)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+Test removes the transition properties while the transition is running, then adds them back in. If working properly the transitions should start from the beginning. But there was a bug that would cause the transition to continue to run (although with no visible effect). So when you restarted, it would pick up where it left off.
+
+lefttranslate
+left:PASS, webkitTransform:PASS
</ins></span></pre></div>
<a id="trunkLayoutTeststransitionscanceltransitionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/transitions/cancel-transition.html (0 => 44696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/transitions/cancel-transition.html                                (rev 0)
+++ trunk/LayoutTests/transitions/cancel-transition.html        2009-06-15 22:21:54 UTC (rev 44696)
</span><span class="lines">@@ -0,0 +1,118 @@
</span><ins>+&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
+   &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
+
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
+    &lt;title&gt;Cancelled Transition Should Not Continue To Run&lt;/title&gt;
+    &lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
+        #container {
+            height: 300px;
+            width: 700px;
+            background: #fcc;
+            font-family: ArialRoundedMTBold, sans-serif;
+            font-size: 200%;
+        }
+  
+        #container div {
+            position: absolute;
+            background-color: #933;
+            width: 200px;
+            height: 100px;
+            left: 50px;
+        }
+        #a {
+            top: 100px;
+        }
+        #container.run #a {
+            left: 450px;
+            -webkit-transition-property: left;
+            -webkit-transition-duration: 0.5s;
+            -webkit-transition-timing-function: linear;
+        }
+        #b {
+            top: 250px;
+        }
+        #container.run #b {
+            -webkit-transform: translate(400px, 0px);
+            -webkit-transition-property: -webkit-transform;
+            -webkit-transition-duration: 0.5s;
+            -webkit-transition-timing-function: linear;
+        }
+    &lt;/style&gt;
+    &lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
+        if (window.layoutTestController) {
+            layoutTestController.dumpAsText();
+            layoutTestController.waitUntilDone();
+        }
+
+        result = &quot;&lt;span style='color:red'&gt;CHECK NOT COMPLETED&lt;/span&gt;&quot;;
+
+        function isEqual(actual, desired, tolerance)
+        {
+            if (tolerance == undefined || tolerance == 0)
+                tolerance = defaultTolerance;
+            var diff = Math.abs(actual - desired);
+            return diff &lt; tolerance;
+        }
+
+        function cancelTransition()
+        {
+            document.getElementById(&quot;container&quot;).className = &quot;&quot;;
+        }
+
+        function restartTransition()
+        {
+            document.getElementById(&quot;container&quot;).className = &quot;run&quot;;
+            setTimeout(&quot;check()&quot;, 250);
+        }
+
+        function check()
+        {
+            var left = parseFloat(window.getComputedStyle(document.getElementById('a')).left);
+            result = &quot;left:&quot;;
+            if (!isEqual(left, 250, 30))
+                result += &quot;&lt;span style='color:red'&gt;FAIL(was:&quot; + left + &quot;, s/b:150)&lt;/span&gt;&quot;;
+            else
+                result += &quot;&lt;span style='color:green'&gt;PASS&lt;/span&gt;&quot;;
+            
+            result += &quot;, webkitTransform:&quot;;
+            
+            var transform = window.getComputedStyle(document.getElementById('b')).webkitTransform;
+            transform = transform.split(&quot;(&quot;);
+            transform = transform[1].split(&quot;,&quot;);
+            if (!isEqual(transform[4], 200, 30))
+                result += &quot;&lt;span style='color:red'&gt;FAIL(was:&quot; + transform[4] + &quot;, s/b:50)&lt;/span&gt;&quot;;
+            else
+                result += &quot;&lt;span style='color:green'&gt;PASS&lt;/span&gt;&quot;;
+        }
+
+        function start()
+        {
+            document.getElementById(&quot;container&quot;).className = &quot;run&quot;;
+            setTimeout(&quot;cancelTransition()&quot;, 100);
+            setTimeout(&quot;restartTransition()&quot;, 200);
+
+            window.setTimeout(function() {
+                document.getElementById('result').innerHTML = result;
+                if (window.layoutTestController)
+                layoutTestController.notifyDone();
+            },
+            500);
+        }
+    &lt;/script&gt;
+&lt;body onload=&quot;start()&quot;&gt;
+&lt;p&gt;
+    Test removes the transition properties while the transition is running, then adds them back in.
+    If working properly the transitions should start from the beginning. But there was a bug that
+    would cause the transition to continue to run (although with no visible effect). So when you
+    restarted, it would pick up where it left off.
+&lt;/p&gt;
+&lt;div id=&quot;container&quot;&gt;
+    &lt;div id=&quot;a&quot; class=&quot;tester&quot;&gt;left&lt;/div&gt;
+    &lt;div id=&quot;b&quot; class=&quot;tester&quot;&gt;translate&lt;/div&gt;
+&lt;/div&gt;
+&lt;div id=&quot;result&quot;&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (44695 => 44696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2009-06-15 21:18:17 UTC (rev 44695)
+++ trunk/WebCore/ChangeLog        2009-06-15 22:21:54 UTC (rev 44696)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2009-06-15  Chris Marrin  &lt;cmarrin@apple.com&gt;
+
+        Reviewed by Simon Fraser  &lt;simon.fraser@apple.com&gt;.
+
+        https://bugs.webkit.org/show_bug.cgi?id=26163
+
+        Added logic to updateTransitions similar to that in updateKeyframeAnimations
+        which detects and removes stale transitions.
+
+        Test: transitions/cancel-transition.html
+
+        * page/animation/CompositeAnimation.cpp:
+        (WebCore::CompositeAnimation::updateTransitions):
+        * page/animation/ImplicitAnimation.cpp:
+        (WebCore::ImplicitAnimation::ImplicitAnimation):
+        * page/animation/ImplicitAnimation.h:
+        (WebCore::ImplicitAnimation::active):
+        (WebCore::ImplicitAnimation::setActive):
+
</ins><span class="cx"> 2009-06-15  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Tim Hatcher.
</span></span></pre></div>
<a id="trunkWebCorepageanimationCompositeAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/animation/CompositeAnimation.cpp (44695 => 44696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/animation/CompositeAnimation.cpp        2009-06-15 21:18:17 UTC (rev 44695)
+++ trunk/WebCore/page/animation/CompositeAnimation.cpp        2009-06-15 22:21:54 UTC (rev 44696)
</span><span class="lines">@@ -67,91 +67,114 @@
</span><span class="cx"> 
</span><span class="cx"> void CompositeAnimation::updateTransitions(RenderObject* renderer, RenderStyle* currentStyle, RenderStyle* targetStyle)
</span><span class="cx"> {
</span><ins>+    // If currentStyle is null or there are no old or new transitions, just skip it
+    if (!currentStyle || (!targetStyle-&gt;transitions() &amp;&amp; m_transitions.isEmpty()))
+        return;
+
+    // Mark all existing transitions as no longer active. We will mark the still active ones
+    // in the next loop and then toss the ones that didn't get marked.
+    CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
+    for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it)
+        it-&gt;second-&gt;setActive(false);
+        
</ins><span class="cx">     RefPtr&lt;RenderStyle&gt; modifiedCurrentStyle;
</span><span class="cx">     
</span><del>-    // If currentStyle is null, we don't do transitions
-    if (!currentStyle || !targetStyle-&gt;transitions())
-        return;
-
</del><span class="cx">     // Check to see if we need to update the active transitions
</span><del>-    for (size_t i = 0; i &lt; targetStyle-&gt;transitions()-&gt;size(); ++i) {
-        const Animation* anim = targetStyle-&gt;transitions()-&gt;animation(i);
-        bool isActiveTransition = anim-&gt;duration() || anim-&gt;delay() &gt; 0;
</del><ins>+    if (targetStyle-&gt;transitions()) {
+        for (size_t i = 0; i &lt; targetStyle-&gt;transitions()-&gt;size(); ++i) {
+            const Animation* anim = targetStyle-&gt;transitions()-&gt;animation(i);
+            bool isActiveTransition = anim-&gt;duration() || anim-&gt;delay() &gt; 0;
</ins><span class="cx"> 
</span><del>-        int prop = anim-&gt;property();
</del><ins>+            int prop = anim-&gt;property();
</ins><span class="cx"> 
</span><del>-        if (prop == cAnimateNone)
-            continue;
</del><ins>+            if (prop == cAnimateNone)
+                continue;
</ins><span class="cx"> 
</span><del>-        bool all = prop == cAnimateAll;
</del><ins>+            bool all = prop == cAnimateAll;
</ins><span class="cx"> 
</span><del>-        // Handle both the 'all' and single property cases. For the single prop case, we make only one pass
-        // through the loop.
-        for (int propertyIndex = 0; propertyIndex &lt; AnimationBase::getNumProperties(); ++propertyIndex) {
-            if (all) {
-                // Get the next property which is not a shorthand.
-                bool isShorthand;
-                prop = AnimationBase::getPropertyAtIndex(propertyIndex, isShorthand);
-                if (isShorthand)
-                    continue;
-            }
</del><ins>+            // Handle both the 'all' and single property cases. For the single prop case, we make only one pass
+            // through the loop.
+            for (int propertyIndex = 0; propertyIndex &lt; AnimationBase::getNumProperties(); ++propertyIndex) {
+                if (all) {
+                    // Get the next property which is not a shorthand.
+                    bool isShorthand;
+                    prop = AnimationBase::getPropertyAtIndex(propertyIndex, isShorthand);
+                    if (isShorthand)
+                        continue;
+                }
</ins><span class="cx"> 
</span><del>-            // ImplicitAnimations are always hashed by actual properties, never cAnimateAll
-            ASSERT(prop &gt;= firstCSSProperty &amp;&amp; prop &lt; (firstCSSProperty + numCSSProperties));
</del><ins>+                // ImplicitAnimations are always hashed by actual properties, never cAnimateAll
+                ASSERT(prop &gt;= firstCSSProperty &amp;&amp; prop &lt; (firstCSSProperty + numCSSProperties));
</ins><span class="cx"> 
</span><del>-            // If there is a running animation for this property, the transition is overridden
-            // and we have to use the unanimatedStyle from the animation. We do the test
-            // against the unanimated style here, but we &quot;override&quot; the transition later.
-            RefPtr&lt;KeyframeAnimation&gt; keyframeAnim = getAnimationForProperty(prop);
-            RenderStyle* fromStyle = keyframeAnim ? keyframeAnim-&gt;unanimatedStyle() : currentStyle;
</del><ins>+                // If there is a running animation for this property, the transition is overridden
+                // and we have to use the unanimatedStyle from the animation. We do the test
+                // against the unanimated style here, but we &quot;override&quot; the transition later.
+                RefPtr&lt;KeyframeAnimation&gt; keyframeAnim = getAnimationForProperty(prop);
+                RenderStyle* fromStyle = keyframeAnim ? keyframeAnim-&gt;unanimatedStyle() : currentStyle;
</ins><span class="cx"> 
</span><del>-            // See if there is a current transition for this prop
-            ImplicitAnimation* implAnim = m_transitions.get(prop).get();
-            bool equal = true;
</del><ins>+                // See if there is a current transition for this prop
+                ImplicitAnimation* implAnim = m_transitions.get(prop).get();
+                bool equal = true;
</ins><span class="cx"> 
</span><del>-            if (implAnim) {
-                // This might be a transition that is just finishing. That would be the case
-                // if it were postActive. But we still need to check for equality because
-                // it could be just finishing AND changing to a new goal state.
-                //
-                // This implAnim might also not be an already running transition. It might be
-                // newly added to the list in a previous iteration. This would happen if
-                // you have both an explicit transition-property and 'all' in the same
-                // list. In this case, the latter one overrides the earlier one, so we
-                // behave as though this is a running animation being replaced.
-                if (!implAnim-&gt;isTargetPropertyEqual(prop, targetStyle)) {
-#if USE(ACCELERATED_COMPOSITING)
-                    // For accelerated animations we need to return a new RenderStyle with the _current_ value
-                    // of the property, so that restarted transitions use the correct starting point.
-                    if (AnimationBase::animationOfPropertyIsAccelerated(prop) &amp;&amp; !implAnim-&gt;isFallbackAnimating()) {
-                        if (!modifiedCurrentStyle)
-                            modifiedCurrentStyle = RenderStyle::clone(currentStyle);
</del><ins>+                if (implAnim) {
+                    implAnim-&gt;setActive(true);
+                    
+                    // This might be a transition that is just finishing. That would be the case
+                    // if it were postActive. But we still need to check for equality because
+                    // it could be just finishing AND changing to a new goal state.
+                    //
+                    // This implAnim might also not be an already running transition. It might be
+                    // newly added to the list in a previous iteration. This would happen if
+                    // you have both an explicit transition-property and 'all' in the same
+                    // list. In this case, the latter one overrides the earlier one, so we
+                    // behave as though this is a running animation being replaced.
+                    if (!implAnim-&gt;isTargetPropertyEqual(prop, targetStyle)) {
+    #if USE(ACCELERATED_COMPOSITING)
+                        // For accelerated animations we need to return a new RenderStyle with the _current_ value
+                        // of the property, so that restarted transitions use the correct starting point.
+                        if (AnimationBase::animationOfPropertyIsAccelerated(prop) &amp;&amp; !implAnim-&gt;isFallbackAnimating()) {
+                            if (!modifiedCurrentStyle)
+                                modifiedCurrentStyle = RenderStyle::clone(currentStyle);
</ins><span class="cx"> 
</span><del>-                        implAnim-&gt;blendPropertyValueInStyle(prop, modifiedCurrentStyle.get());
</del><ins>+                            implAnim-&gt;blendPropertyValueInStyle(prop, modifiedCurrentStyle.get());
+                        }
+    #endif
+                        m_transitions.remove(prop);
+                        equal = false;
</ins><span class="cx">                     }
</span><del>-#endif
-                    m_transitions.remove(prop);
-                    equal = false;
</del><ins>+                } else {
+                    // We need to start a transition if it is active and the properties don't match
+                    equal = !isActiveTransition || AnimationBase::propertiesEqual(prop, fromStyle, targetStyle);
</ins><span class="cx">                 }
</span><del>-            } else {
-                // We need to start a transition if it is active and the properties don't match
-                equal = !isActiveTransition || AnimationBase::propertiesEqual(prop, fromStyle, targetStyle);
-            }
</del><span class="cx"> 
</span><del>-            // We can be in this loop with an inactive transition (!isActiveTransition). We need
-            // to do that to check to see if we are canceling a transition. But we don't want to
-            // start one of the inactive transitions. So short circuit that here. (See
-            // &lt;https://bugs.webkit.org/show_bug.cgi?id=24787&gt;
-            if (!equal &amp;&amp; isActiveTransition) {
-                // Add the new transition
-                m_transitions.set(prop, ImplicitAnimation::create(const_cast&lt;Animation*&gt;(anim), prop, renderer, this, modifiedCurrentStyle ? modifiedCurrentStyle.get() : fromStyle));
</del><ins>+                // We can be in this loop with an inactive transition (!isActiveTransition). We need
+                // to do that to check to see if we are canceling a transition. But we don't want to
+                // start one of the inactive transitions. So short circuit that here. (See
+                // &lt;https://bugs.webkit.org/show_bug.cgi?id=24787&gt;
+                if (!equal &amp;&amp; isActiveTransition) {
+                    // Add the new transition
+                    m_transitions.set(prop, ImplicitAnimation::create(const_cast&lt;Animation*&gt;(anim), prop, renderer, this, modifiedCurrentStyle ? modifiedCurrentStyle.get() : fromStyle));
+                }
+                
+                // We only need one pass for the single prop case
+                if (!all)
+                    break;
</ins><span class="cx">             }
</span><del>-            
-            // We only need one pass for the single prop case
-            if (!all)
-                break;
</del><span class="cx">         }
</span><span class="cx">     }
</span><ins>+
+    // Make a list of transitions to be removed
+    Vector&lt;int&gt; toBeRemoved;
+    end = m_transitions.end();
+    for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
+        ImplicitAnimation* anim = it-&gt;second.get();
+        if (!anim-&gt;active())
+            toBeRemoved.append(anim-&gt;animatingProperty());
+    }
+
+    // Now remove the transitions from the list
+    for (size_t j = 0; j &lt; toBeRemoved.size(); ++j)
+        m_transitions.remove(toBeRemoved[j]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CompositeAnimation::updateKeyframeAnimations(RenderObject* renderer, RenderStyle* currentStyle, RenderStyle* targetStyle)
</span></span></pre></div>
<a id="trunkWebCorepageanimationImplicitAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/animation/ImplicitAnimation.cpp (44695 => 44696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/animation/ImplicitAnimation.cpp        2009-06-15 21:18:17 UTC (rev 44695)
+++ trunk/WebCore/page/animation/ImplicitAnimation.cpp        2009-06-15 22:21:54 UTC (rev 44696)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     , m_transitionProperty(transition-&gt;property())
</span><span class="cx">     , m_animatingProperty(animatingProperty)
</span><span class="cx">     , m_overridden(false)
</span><ins>+    , m_active(true)
</ins><span class="cx">     , m_fromStyle(fromStyle)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(animatingProperty != cAnimateAll);
</span></span></pre></div>
<a id="trunkWebCorepageanimationImplicitAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/animation/ImplicitAnimation.h (44695 => 44696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/animation/ImplicitAnimation.h        2009-06-15 21:18:17 UTC (rev 44695)
+++ trunk/WebCore/page/animation/ImplicitAnimation.h        2009-06-15 22:21:54 UTC (rev 44696)
</span><span class="lines">@@ -66,6 +66,9 @@
</span><span class="cx">     void blendPropertyValueInStyle(int, RenderStyle* currentStyle);
</span><span class="cx"> 
</span><span class="cx">     virtual double timeToNextService();
</span><ins>+    
+    bool active() const { return m_active; }
+    void setActive(bool b) { m_active = b; }
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     bool shouldSendEventForListener(Document::ListenerType) const;    
</span><span class="lines">@@ -80,6 +83,7 @@
</span><span class="cx">     int m_transitionProperty;   // Transition property as specified in the RenderStyle. May be cAnimateAll
</span><span class="cx">     int m_animatingProperty;    // Specific property for this ImplicitAnimation
</span><span class="cx">     bool m_overridden;          // true when there is a keyframe animation that overrides the transitioning property
</span><ins>+    bool m_active;              // used for culling the list of transitions
</ins><span class="cx"> 
</span><span class="cx">     // The two styles that we are blending.
</span><span class="cx">     RefPtr&lt;RenderStyle&gt; m_fromStyle;
</span></span></pre>
</div>
</div>

</body>
</html>