<!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>[183364] trunk/Source/WebCore</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/183364">183364</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-04-26 13:38:20 -0700 (Sun, 26 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Modernize animations code
https://bugs.webkit.org/show_bug.cgi?id=144196

Reviewed by Darin Adler.

General cleanup in animation-related code.

Use C++ references where possible. Use modern loops. Make classes fast-allocated.
Use C++11 member initialization. Order member variables to optimize packing.

This removes some null checks in CompositeAnimation, but the values in m_transitions
and m_keyframeAnimations can never be null.

No behavior change.

* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::AnimationBase):
(WebCore::AnimationBase::animationsMatch):
(WebCore::AnimationBase::updateStateMachine):
(WebCore::AnimationBase::fireAnimationEventsIfNeeded):
(WebCore::AnimationBase::beginAnimationUpdateTime):
(WebCore::AnimationBase::getElapsedTime):
* page/animation/AnimationBase.h:
(WebCore::AnimationBase::animation):
(WebCore::AnimationBase::setAnimation):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
(WebCore::AnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse):
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::CompositeAnimation):
(WebCore::CompositeAnimation::clearRenderer):
(WebCore::CompositeAnimation::updateTransitions):
(WebCore::CompositeAnimation::updateKeyframeAnimations):
(WebCore::CompositeAnimation::animate):
(WebCore::CompositeAnimation::getAnimatedStyle):
(WebCore::CompositeAnimation::timeToNextService):
(WebCore::CompositeAnimation::getAnimationForProperty):
(WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
(WebCore::CompositeAnimation::suspendAnimations):
(WebCore::CompositeAnimation::resumeAnimations):
(WebCore::CompositeAnimation::overrideImplicitAnimations):
(WebCore::CompositeAnimation::resumeOverriddenImplicitAnimations):
(WebCore::CompositeAnimation::isAnimatingProperty):
(WebCore::CompositeAnimation::pauseTransitionAtTime):
(WebCore::CompositeAnimation::numberOfActiveAnimations):
* page/animation/CompositeAnimation.h:
(WebCore::CompositeAnimation::create):
(WebCore::CompositeAnimation::animationController):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::ImplicitAnimation):
(WebCore::ImplicitAnimation::sendTransitionEvent):
* page/animation/ImplicitAnimation.h:
(WebCore::ImplicitAnimation::create):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::animate):
(WebCore::KeyframeAnimation::getAnimatedStyle):
(WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
(WebCore::KeyframeAnimation::startAnimation):
(WebCore::KeyframeAnimation::sendAnimationEvent):
(WebCore::KeyframeAnimation::overrideAnimations):
(WebCore::KeyframeAnimation::resumeOverriddenAnimations):
(WebCore::KeyframeAnimation::timeToNextService):
* page/animation/KeyframeAnimation.h:
* platform/animation/Animation.cpp:
(WebCore::Animation::animationsMatch):
* platform/animation/Animation.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paint):
(WebCore::performOverlapTests):
* rendering/style/KeyframeList.h:
(WebCore::KeyframeList::properties):
(WebCore::KeyframeList::keyframes):
(WebCore::KeyframeList::beginProperties): Deleted.
(WebCore::KeyframeList::endProperties): Deleted.
(WebCore::KeyframeList::operator[]): Deleted.
* rendering/style/RenderStyle.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageanimationAnimationBasecpp">trunk/Source/WebCore/page/animation/AnimationBase.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationAnimationBaseh">trunk/Source/WebCore/page/animation/AnimationBase.h</a></li>
<li><a href="#trunkSourceWebCorepageanimationAnimationControllercpp">trunk/Source/WebCore/page/animation/AnimationController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationCompositeAnimationcpp">trunk/Source/WebCore/page/animation/CompositeAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationCompositeAnimationh">trunk/Source/WebCore/page/animation/CompositeAnimation.h</a></li>
<li><a href="#trunkSourceWebCorepageanimationImplicitAnimationcpp">trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationImplicitAnimationh">trunk/Source/WebCore/page/animation/ImplicitAnimation.h</a></li>
<li><a href="#trunkSourceWebCorepageanimationKeyframeAnimationcpp">trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationKeyframeAnimationh">trunk/Source/WebCore/page/animation/KeyframeAnimation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformanimationAnimationcpp">trunk/Source/WebCore/platform/animation/Animation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformanimationAnimationh">trunk/Source/WebCore/platform/animation/Animation.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleKeyframeListh">trunk/Source/WebCore/rendering/style/KeyframeList.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/ChangeLog        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -1,3 +1,83 @@
</span><ins>+2015-04-26  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Modernize animations code
+        https://bugs.webkit.org/show_bug.cgi?id=144196
+
+        Reviewed by Darin Adler.
+        
+        General cleanup in animation-related code.
+        
+        Use C++ references where possible. Use modern loops. Make classes fast-allocated.
+        Use C++11 member initialization. Order member variables to optimize packing.
+        
+        This removes some null checks in CompositeAnimation, but the values in m_transitions
+        and m_keyframeAnimations can never be null.
+        
+        No behavior change.
+
+        * page/animation/AnimationBase.cpp:
+        (WebCore::AnimationBase::AnimationBase):
+        (WebCore::AnimationBase::animationsMatch):
+        (WebCore::AnimationBase::updateStateMachine):
+        (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
+        (WebCore::AnimationBase::beginAnimationUpdateTime):
+        (WebCore::AnimationBase::getElapsedTime):
+        * page/animation/AnimationBase.h:
+        (WebCore::AnimationBase::animation):
+        (WebCore::AnimationBase::setAnimation):
+        * page/animation/AnimationController.cpp:
+        (WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
+        (WebCore::AnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse):
+        * page/animation/CompositeAnimation.cpp:
+        (WebCore::CompositeAnimation::CompositeAnimation):
+        (WebCore::CompositeAnimation::clearRenderer):
+        (WebCore::CompositeAnimation::updateTransitions):
+        (WebCore::CompositeAnimation::updateKeyframeAnimations):
+        (WebCore::CompositeAnimation::animate):
+        (WebCore::CompositeAnimation::getAnimatedStyle):
+        (WebCore::CompositeAnimation::timeToNextService):
+        (WebCore::CompositeAnimation::getAnimationForProperty):
+        (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
+        (WebCore::CompositeAnimation::suspendAnimations):
+        (WebCore::CompositeAnimation::resumeAnimations):
+        (WebCore::CompositeAnimation::overrideImplicitAnimations):
+        (WebCore::CompositeAnimation::resumeOverriddenImplicitAnimations):
+        (WebCore::CompositeAnimation::isAnimatingProperty):
+        (WebCore::CompositeAnimation::pauseTransitionAtTime):
+        (WebCore::CompositeAnimation::numberOfActiveAnimations):
+        * page/animation/CompositeAnimation.h:
+        (WebCore::CompositeAnimation::create):
+        (WebCore::CompositeAnimation::animationController):
+        * page/animation/ImplicitAnimation.cpp:
+        (WebCore::ImplicitAnimation::ImplicitAnimation):
+        (WebCore::ImplicitAnimation::sendTransitionEvent):
+        * page/animation/ImplicitAnimation.h:
+        (WebCore::ImplicitAnimation::create):
+        * page/animation/KeyframeAnimation.cpp:
+        (WebCore::KeyframeAnimation::KeyframeAnimation):
+        (WebCore::KeyframeAnimation::animate):
+        (WebCore::KeyframeAnimation::getAnimatedStyle):
+        (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
+        (WebCore::KeyframeAnimation::startAnimation):
+        (WebCore::KeyframeAnimation::sendAnimationEvent):
+        (WebCore::KeyframeAnimation::overrideAnimations):
+        (WebCore::KeyframeAnimation::resumeOverriddenAnimations):
+        (WebCore::KeyframeAnimation::timeToNextService):
+        * page/animation/KeyframeAnimation.h:
+        * platform/animation/Animation.cpp:
+        (WebCore::Animation::animationsMatch):
+        * platform/animation/Animation.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paint):
+        (WebCore::performOverlapTests):
+        * rendering/style/KeyframeList.h:
+        (WebCore::KeyframeList::properties):
+        (WebCore::KeyframeList::keyframes):
+        (WebCore::KeyframeList::beginProperties): Deleted.
+        (WebCore::KeyframeList::endProperties): Deleted.
+        (WebCore::KeyframeList::operator[]): Deleted.
+        * rendering/style/RenderStyle.h:
+
</ins><span class="cx"> 2015-04-25  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Expand compositing coverage rect when scrolling and animating
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationAnimationBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/AnimationBase.cpp (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/AnimationBase.cpp        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/page/animation/AnimationBase.cpp        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -70,19 +70,10 @@
</span><span class="cx">     return floor(numSteps * t) / numSteps;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AnimationBase::AnimationBase(const Animation&amp; transition, RenderElement* renderer, CompositeAnimation* compositeAnimation)
-    : m_animationState(AnimationState::New)
-    , m_isAccelerated(false)
-    , m_transformFunctionListValid(false)
-    , m_filterFunctionListsMatch(false)
-    , m_startTime(0)
-    , m_pauseTime(-1)
-    , m_requestedStartTime(0)
-    , m_totalDuration(-1)
-    , m_nextIterationDuration(-1)
-    , m_object(renderer)
-    , m_animation(const_cast&lt;Animation*&gt;(&amp;transition))
</del><ins>+AnimationBase::AnimationBase(Animation&amp; animation, RenderElement* renderer, CompositeAnimation* compositeAnimation)
+    : m_object(renderer)
</ins><span class="cx">     , m_compositeAnimation(compositeAnimation)
</span><ins>+    , m_animation(animation)
</ins><span class="cx"> {
</span><span class="cx">     // Compute the total duration
</span><span class="cx">     if (m_animation-&gt;iterationCount() &gt; 0)
</span><span class="lines">@@ -106,9 +97,9 @@
</span><span class="cx">     return m_animation-&gt;playState() == AnimPlayStatePlaying;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool AnimationBase::animationsMatch(const Animation* anim) const
</del><ins>+bool AnimationBase::animationsMatch(const Animation&amp; animation) const
</ins><span class="cx"> {
</span><del>-    return m_animation-&gt;animationsMatch(anim);
</del><ins>+    return m_animation-&gt;animationsMatch(animation);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !LOG_DISABLED
</span><span class="lines">@@ -161,7 +152,7 @@
</span><span class="cx">     // If we get AnimationStateInput::RestartAnimation then we force a new animation, regardless of state.
</span><span class="cx">     if (input == AnimationStateInput::MakeNew) {
</span><span class="cx">         if (m_animationState == AnimationState::StartWaitStyleAvailable)
</span><del>-            m_compositeAnimation-&gt;animationController()-&gt;removeFromAnimationsWaitingForStyle(this);
</del><ins>+            m_compositeAnimation-&gt;animationController().removeFromAnimationsWaitingForStyle(this);
</ins><span class="cx">         LOG(Animations, &quot;%p AnimationState %s -&gt; New&quot;, this, nameForState(m_animationState));
</span><span class="cx">         m_animationState = AnimationState::New;
</span><span class="cx">         m_startTime = 0;
</span><span class="lines">@@ -174,7 +165,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (input == AnimationStateInput::RestartAnimation) {
</span><span class="cx">         if (m_animationState == AnimationState::StartWaitStyleAvailable)
</span><del>-            m_compositeAnimation-&gt;animationController()-&gt;removeFromAnimationsWaitingForStyle(this);
</del><ins>+            m_compositeAnimation-&gt;animationController().removeFromAnimationsWaitingForStyle(this);
</ins><span class="cx">         LOG(Animations, &quot;%p AnimationState %s -&gt; New&quot;, this, nameForState(m_animationState));
</span><span class="cx">         m_animationState = AnimationState::New;
</span><span class="cx">         m_startTime = 0;
</span><span class="lines">@@ -190,7 +181,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (input == AnimationStateInput::EndAnimation) {
</span><span class="cx">         if (m_animationState == AnimationState::StartWaitStyleAvailable)
</span><del>-            m_compositeAnimation-&gt;animationController()-&gt;removeFromAnimationsWaitingForStyle(this);
</del><ins>+            m_compositeAnimation-&gt;animationController().removeFromAnimationsWaitingForStyle(this);
</ins><span class="cx">         LOG(Animations, &quot;%p AnimationState %s -&gt; Done&quot;, this, nameForState(m_animationState));
</span><span class="cx">         m_animationState = AnimationState::Done;
</span><span class="cx">         endAnimation();
</span><span class="lines">@@ -232,7 +223,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><span class="cx">             if (m_animation-&gt;trigger() &amp;&amp; m_animation-&gt;trigger()-&gt;isScrollAnimationTrigger())
</span><del>-                m_compositeAnimation-&gt;animationController()-&gt;addToAnimationsDependentOnScroll(this);
</del><ins>+                m_compositeAnimation-&gt;animationController().addToAnimationsDependentOnScroll(this);
</ins><span class="cx"> #endif
</span><span class="cx">             break;
</span><span class="cx">         case AnimationState::StartWaitTimer:
</span><span class="lines">@@ -243,11 +234,11 @@
</span><span class="cx">                 // Start timer has fired, tell the animation to start and wait for it to respond with start time
</span><span class="cx">                 LOG(Animations, &quot;%p AnimationState %s -&gt; StartWaitStyleAvailable&quot;, this, nameForState(m_animationState));
</span><span class="cx">                 m_animationState = AnimationState::StartWaitStyleAvailable;
</span><del>-                m_compositeAnimation-&gt;animationController()-&gt;addToAnimationsWaitingForStyle(this);
</del><ins>+                m_compositeAnimation-&gt;animationController().addToAnimationsWaitingForStyle(this);
</ins><span class="cx"> 
</span><span class="cx">                 // Trigger a render so we can start the animation
</span><span class="cx">                 if (m_object &amp;&amp; m_object-&gt;element())
</span><del>-                    m_compositeAnimation-&gt;animationController()-&gt;addElementChangeToDispatch(*m_object-&gt;element());
</del><ins>+                    m_compositeAnimation-&gt;animationController().addElementChangeToDispatch(*m_object-&gt;element());
</ins><span class="cx">             } else {
</span><span class="cx">                 ASSERT(!paused());
</span><span class="cx">                 // We're waiting for the start timer to fire and we got a pause. Cancel the timer, pause and wait
</span><span class="lines">@@ -281,7 +272,7 @@
</span><span class="cx">                         timeOffset = -m_animation-&gt;delay();
</span><span class="cx">                     bool started = startAnimation(timeOffset);
</span><span class="cx"> 
</span><del>-                    m_compositeAnimation-&gt;animationController()-&gt;addToAnimationsWaitingForStartTimeResponse(this, started);
</del><ins>+                    m_compositeAnimation-&gt;animationController().addToAnimationsWaitingForStartTimeResponse(this, started);
</ins><span class="cx">                     m_isAccelerated = started;
</span><span class="cx">                 }
</span><span class="cx">             } else {
</span><span class="lines">@@ -312,7 +303,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // Dispatch updateStyleIfNeeded so we can start the animation
</span><span class="cx">                 if (m_object &amp;&amp; m_object-&gt;element())
</span><del>-                    m_compositeAnimation-&gt;animationController()-&gt;addElementChangeToDispatch(*m_object-&gt;element());
</del><ins>+                    m_compositeAnimation-&gt;animationController().addElementChangeToDispatch(*m_object-&gt;element());
</ins><span class="cx">             } else {
</span><span class="cx">                 // We are pausing while waiting for a start response. Cancel the animation and wait. When 
</span><span class="cx">                 // we unpause, we will act as though the start timer just fired
</span><span class="lines">@@ -363,7 +354,7 @@
</span><span class="cx"> 
</span><span class="cx">                     // Fire off another style change so we can set the final value
</span><span class="cx">                     if (m_object-&gt;element())
</span><del>-                        m_compositeAnimation-&gt;animationController()-&gt;addElementChangeToDispatch(*m_object-&gt;element());
</del><ins>+                        m_compositeAnimation-&gt;animationController().addElementChangeToDispatch(*m_object-&gt;element());
</ins><span class="cx">                 }
</span><span class="cx">             } else {
</span><span class="cx">                 // We are pausing while running. Cancel the animation and wait
</span><span class="lines">@@ -432,7 +423,7 @@
</span><span class="cx">                         m_isAccelerated = true;
</span><span class="cx">                     } else {
</span><span class="cx">                         bool started = startAnimation(beginAnimationUpdateTime() - m_startTime);
</span><del>-                        m_compositeAnimation-&gt;animationController()-&gt;addToAnimationsWaitingForStartTimeResponse(this, started);
</del><ins>+                        m_compositeAnimation-&gt;animationController().addToAnimationsWaitingForStartTimeResponse(this, started);
</ins><span class="cx">                         m_isAccelerated = started;
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="lines">@@ -487,7 +478,7 @@
</span><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><span class="cx">         if (m_animation-&gt;trigger() &amp;&amp; m_animation-&gt;trigger()-&gt;isScrollAnimationTrigger()) {
</span><span class="cx">             if (m_object) {
</span><del>-                float offset = m_compositeAnimation-&gt;animationController()-&gt;scrollPosition();
</del><ins>+                float offset = m_compositeAnimation-&gt;animationController().scrollPosition();
</ins><span class="cx">                 ScrollAnimationTrigger&amp; scrollTrigger = downcast&lt;ScrollAnimationTrigger&gt;(*m_animation-&gt;trigger().get());
</span><span class="cx">                 if (offset &gt; scrollTrigger.startValue().value())
</span><span class="cx">                     updateStateMachine(AnimationStateInput::StartTimerFired, 0);
</span><span class="lines">@@ -724,7 +715,7 @@
</span><span class="cx">     if (!m_compositeAnimation)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return m_compositeAnimation-&gt;animationController()-&gt;beginAnimationUpdateTime();
</del><ins>+    return m_compositeAnimation-&gt;animationController().beginAnimationUpdateTime();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double AnimationBase::getElapsedTime() const
</span><span class="lines">@@ -733,7 +724,7 @@
</span><span class="cx">     if (m_animation-&gt;trigger() &amp;&amp; m_animation-&gt;trigger()-&gt;isScrollAnimationTrigger()) {
</span><span class="cx">         ScrollAnimationTrigger&amp; scrollTrigger = downcast&lt;ScrollAnimationTrigger&gt;(*m_animation-&gt;trigger().get());
</span><span class="cx">         if (scrollTrigger.hasEndValue() &amp;&amp; m_object) {
</span><del>-            float offset = m_compositeAnimation-&gt;animationController()-&gt;scrollPosition();
</del><ins>+            float offset = m_compositeAnimation-&gt;animationController().scrollPosition();
</ins><span class="cx">             float startValue = scrollTrigger.startValue().value();
</span><span class="cx">             if (offset &lt; startValue)
</span><span class="cx">                 return 0;
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationAnimationBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/AnimationBase.h (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/AnimationBase.h        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/page/animation/AnimationBase.h        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -50,9 +50,9 @@
</span><span class="cx"> class AnimationBase : public RefCounted&lt;AnimationBase&gt; {
</span><span class="cx">     friend class CompositeAnimation;
</span><span class="cx">     friend class CSSPropertyAnimation;
</span><del>-
</del><ins>+    WTF_MAKE_FAST_ALLOCATED;
</ins><span class="cx"> public:
</span><del>-    AnimationBase(const Animation&amp; transition, RenderElement*, CompositeAnimation*);
</del><ins>+    AnimationBase(Animation&amp; transition, RenderElement*, CompositeAnimation*);
</ins><span class="cx">     virtual ~AnimationBase() { }
</span><span class="cx"> 
</span><span class="cx">     RenderElement* renderer() const { return m_object; }
</span><span class="lines">@@ -144,9 +144,10 @@
</span><span class="cx"> 
</span><span class="cx">     void fireAnimationEventsIfNeeded();
</span><span class="cx"> 
</span><del>-    bool animationsMatch(const Animation*) const;
</del><ins>+    bool animationsMatch(const Animation&amp;) const;
</ins><span class="cx"> 
</span><del>-    void setAnimation(const Animation&amp; animation) { m_animation = const_cast&lt;Animation*&gt;(&amp;animation); }
</del><ins>+    const Animation&amp; animation() const { return m_animation; }
+    void setAnimation(Animation&amp; animation) { m_animation = animation; }
</ins><span class="cx"> 
</span><span class="cx">     // Return true if this animation is overridden. This will only be the case for
</span><span class="cx">     // ImplicitAnimations and is used to determine whether or not we should force
</span><span class="lines">@@ -210,8 +211,6 @@
</span><span class="cx">         updateStateMachine(AnimationStateInput::StyleAvailable, -1);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    const Animation&amp; animation() const { return *m_animation; }
-
</del><span class="cx"> protected:
</span><span class="cx">     virtual void overrideAnimations() { }
</span><span class="cx">     virtual void resumeOverriddenAnimations() { }
</span><span class="lines">@@ -244,22 +243,20 @@
</span><span class="cx">     bool computeTransformedExtentViaTransformList(const FloatRect&amp; rendererBox, const RenderStyle&amp;, LayoutRect&amp; bounds) const;
</span><span class="cx">     bool computeTransformedExtentViaMatrix(const FloatRect&amp; rendererBox, const RenderStyle&amp;, LayoutRect&amp; bounds) const;
</span><span class="cx"> 
</span><del>-    AnimationState m_animationState;
-
-    bool m_isAccelerated;
-    bool m_transformFunctionListValid;
-    bool m_filterFunctionListsMatch;
-    double m_startTime;
-    double m_pauseTime;
-    double m_requestedStartTime;
-
-    double m_totalDuration;
-    double m_nextIterationDuration;
-
</del><span class="cx">     RenderElement* m_object;
</span><ins>+    CompositeAnimation* m_compositeAnimation; // Ideally this would be a reference, but it has to be cleared if an animation is destroyed inside an event callback.
+    Ref&lt;Animation&gt; m_animation;
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;Animation&gt; m_animation;
-    CompositeAnimation* m_compositeAnimation;
</del><ins>+    double m_startTime { 0 };
+    double m_pauseTime { -1 };
+    double m_requestedStartTime { 0 };
+    double m_totalDuration { -1 };
+    double m_nextIterationDuration { -1 };
+
+    AnimationState m_animationState { AnimationState::New };
+    bool m_isAccelerated { false };
+    bool m_transformFunctionListValid { false };
+    bool m_filterFunctionListsMatch { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationAnimationControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/AnimationController.cpp (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/AnimationController.cpp        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/page/animation/AnimationController.cpp        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> {
</span><span class="cx">     auto result = m_compositeAnimations.add(&amp;renderer, nullptr);
</span><span class="cx">     if (result.isNewEntry) {
</span><del>-        result.iterator-&gt;value = CompositeAnimation::create(this);
</del><ins>+        result.iterator-&gt;value = CompositeAnimation::create(*this);
</ins><span class="cx">         renderer.setIsCSSAnimating(true);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -487,7 +487,7 @@
</span><span class="cx">     
</span><span class="cx">     if (willGetResponse)
</span><span class="cx">         m_waitingForAsyncStartNotification = true;
</span><del>-    
</del><ins>+
</ins><span class="cx">     m_animationsWaitingForStartTimeResponse.add(animation);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCompositeAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CompositeAnimation.cpp (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CompositeAnimation.cpp        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/page/animation/CompositeAnimation.cpp        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -41,13 +41,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-CompositeAnimation::CompositeAnimation(AnimationControllerPrivate* animationController)
</del><ins>+CompositeAnimation::CompositeAnimation(AnimationControllerPrivate&amp; animationController)
</ins><span class="cx">     : m_animationController(animationController)
</span><del>-#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
-    , m_hasScrollTriggeredAnimation(false)
-#endif
</del><span class="cx"> {
</span><del>-    m_suspended = animationController-&gt;isSuspended() &amp;&amp; !animationController-&gt;allowsNewAnimationsWhileSuspended();
</del><ins>+    m_suspended = m_animationController.isSuspended() &amp;&amp; !m_animationController.allowsNewAnimationsWhileSuspended();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CompositeAnimation::~CompositeAnimation()
</span><span class="lines">@@ -65,20 +62,16 @@
</span><span class="cx">     if (!m_transitions.isEmpty()) {
</span><span class="cx">         // Clear the renderers from all running animations, in case we are in the middle of
</span><span class="cx">         // an animation callback (see https://bugs.webkit.org/show_bug.cgi?id=22052)
</span><del>-        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
-        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
-            ImplicitAnimation* transition = it-&gt;value.get();
-            animationController()-&gt;animationWillBeRemoved(transition);
</del><ins>+        for (auto&amp; transition : m_transitions.values()) {
+            animationController().animationWillBeRemoved(transition.get());
</ins><span class="cx">             transition-&gt;clear();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     if (!m_keyframeAnimations.isEmpty()) {
</span><span class="cx">         m_keyframeAnimations.checkConsistency();
</span><del>-        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
-        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
-            KeyframeAnimation* anim = it-&gt;value.get();
-            animationController()-&gt;animationWillBeRemoved(anim);
-            anim-&gt;clear();
</del><ins>+        for (auto&amp; animation : m_keyframeAnimations.values()) {
+            animationController().animationWillBeRemoved(animation.get());
+            animation-&gt;clear();
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -91,16 +84,15 @@
</span><span class="cx"> 
</span><span class="cx">     // Mark all existing transitions as no longer active. We will mark the still active ones
</span><span class="cx">     // in the next loop and then toss the ones that didn't get marked.
</span><del>-    CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
-    for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it)
-        it-&gt;value-&gt;setActive(false);
</del><ins>+    for (auto&amp; transition : m_transitions.values())
+        transition-&gt;setActive(false);
</ins><span class="cx">         
</span><span class="cx">     RefPtr&lt;RenderStyle&gt; modifiedCurrentStyle;
</span><span class="cx">     
</span><span class="cx">     // Check to see if we need to update the active transitions
</span><span class="cx">     if (targetStyle-&gt;transitions()) {
</span><span class="cx">         for (size_t i = 0; i &lt; targetStyle-&gt;transitions()-&gt;size(); ++i) {
</span><del>-            const Animation&amp; animation = targetStyle-&gt;transitions()-&gt;animation(i);
</del><ins>+            Animation&amp; animation = targetStyle-&gt;transitions()-&gt;animation(i);
</ins><span class="cx">             bool isActiveTransition = !m_suspended &amp;&amp; (animation.duration() || animation.delay() &gt; 0);
</span><span class="cx"> 
</span><span class="cx">             Animation::AnimationMode mode = animation.animationMode();
</span><span class="lines">@@ -160,7 +152,7 @@
</span><span class="cx">                             implAnim-&gt;blendPropertyValueInStyle(prop, modifiedCurrentStyle.get());
</span><span class="cx">                         }
</span><span class="cx">                         LOG(Animations, &quot;Removing existing ImplicitAnimation %p for property %s&quot;, implAnim, getPropertyName(prop));
</span><del>-                        animationController()-&gt;animationWillBeRemoved(implAnim);
</del><ins>+                        animationController().animationWillBeRemoved(implAnim);
</ins><span class="cx">                         m_transitions.remove(prop);
</span><span class="cx">                         equal = false;
</span><span class="cx">                     }
</span><span class="lines">@@ -189,19 +181,17 @@
</span><span class="cx"> 
</span><span class="cx">     // Make a list of transitions to be removed
</span><span class="cx">     Vector&lt;int&gt; toBeRemoved;
</span><del>-    end = m_transitions.end();
-    for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
-        ImplicitAnimation* anim = it-&gt;value.get();
-        if (!anim-&gt;active()) {
-            animationController()-&gt;animationWillBeRemoved(anim);
-            toBeRemoved.append(anim-&gt;animatingProperty());
-            LOG(Animations, &quot;Removing ImplicitAnimation %p for property %s&quot;, anim, getPropertyName(anim-&gt;animatingProperty()));
</del><ins>+    for (auto&amp; transition : m_transitions.values()) {
+        if (!transition-&gt;active()) {
+            animationController().animationWillBeRemoved(transition.get());
+            toBeRemoved.append(transition-&gt;animatingProperty());
+            LOG(Animations, &quot;Removing ImplicitAnimation %p for property %s&quot;, transition.get(), getPropertyName(transition-&gt;animatingProperty()));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Now remove the transitions from the list
</span><del>-    for (size_t j = 0; j &lt; toBeRemoved.size(); ++j)
-        m_transitions.remove(toBeRemoved[j]);
</del><ins>+    for (auto propertyToRemove : toBeRemoved)
+        m_transitions.remove(propertyToRemove);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CompositeAnimation::updateKeyframeAnimations(RenderElement* renderer, RenderStyle* currentStyle, RenderStyle* targetStyle)
</span><span class="lines">@@ -211,20 +201,18 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_keyframeAnimations.checkConsistency();
</span><del>-
-    AnimationNameMap::const_iterator kfend = m_keyframeAnimations.end();
</del><span class="cx">     
</span><span class="cx">     if (currentStyle &amp;&amp; currentStyle-&gt;hasAnimations() &amp;&amp; targetStyle-&gt;hasAnimations() &amp;&amp; *(currentStyle-&gt;animations()) == *(targetStyle-&gt;animations())) {
</span><span class="cx">         // The current and target animations are the same so we just need to toss any 
</span><span class="cx">         // animation which is finished (postActive).
</span><del>-        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != kfend; ++it) {
-            if (it-&gt;value-&gt;postActive())
-                it-&gt;value-&gt;setIndex(-1);
</del><ins>+        for (auto&amp; animation : m_keyframeAnimations.values()) {
+            if (animation-&gt;postActive())
+                animation-&gt;setIndex(-1);
</ins><span class="cx">         }
</span><span class="cx">     } else {
</span><span class="cx">         // Mark all existing animations as no longer active.
</span><del>-        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != kfend; ++it)
-            it-&gt;value-&gt;setIndex(-1);
</del><ins>+        for (auto&amp; animation : m_keyframeAnimations.values())
+            animation-&gt;setIndex(-1);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><span class="cx">         m_hasScrollTriggeredAnimation = false;
</span><span class="lines">@@ -239,7 +227,7 @@
</span><span class="cx">         if (targetStyle-&gt;animations()) {
</span><span class="cx">             int numAnims = targetStyle-&gt;animations()-&gt;size();
</span><span class="cx">             for (int i = 0; i &lt; numAnims; ++i) {
</span><del>-                const Animation&amp; animation = targetStyle-&gt;animations()-&gt;animation(i);
</del><ins>+                Animation&amp; animation = targetStyle-&gt;animations()-&gt;animation(i);
</ins><span class="cx">                 AtomicString animationName(animation.name());
</span><span class="cx"> 
</span><span class="cx">                 if (!animation.isValidAnimation())
</span><span class="lines">@@ -274,8 +262,8 @@
</span><span class="cx">                         LOG(Animations, &quot;  (created in suspended/paused state)&quot;);
</span><span class="cx">                     }
</span><span class="cx"> #if !LOG_DISABLED
</span><del>-                    for (auto it = keyframeAnim-&gt;keyframes().beginProperties(), end = keyframeAnim-&gt;keyframes().endProperties(); it != end; ++it)
-                        LOG(Animations, &quot;  property %s&quot;, getPropertyName(*it));
</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><span class="lines">@@ -295,20 +283,18 @@
</span><span class="cx">     
</span><span class="cx">     // Make a list of animations to be removed.
</span><span class="cx">     Vector&lt;AtomicStringImpl*&gt; animsToBeRemoved;
</span><del>-    kfend = m_keyframeAnimations.end();
-    for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != kfend; ++it) {
-        KeyframeAnimation* keyframeAnim = it-&gt;value.get();
-        if (keyframeAnim-&gt;index() &lt; 0) {
-            animsToBeRemoved.append(keyframeAnim-&gt;name().impl());
-            animationController()-&gt;animationWillBeRemoved(keyframeAnim);
-            keyframeAnim-&gt;clear();
-            LOG(Animations, &quot;Removing KeyframeAnimation %p&quot;, keyframeAnim);
</del><ins>+    for (auto&amp; animation : m_keyframeAnimations.values()) {
+        if (animation-&gt;index() &lt; 0) {
+            animsToBeRemoved.append(animation-&gt;name().impl());
+            animationController().animationWillBeRemoved(animation.get());
+            animation-&gt;clear();
+            LOG(Animations, &quot;Removing KeyframeAnimation %p&quot;, animation.get());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // Now remove the animations from the list.
</span><del>-    for (size_t j = 0; j &lt; animsToBeRemoved.size(); ++j)
-        m_keyframeAnimations.remove(animsToBeRemoved[j]);
</del><ins>+    for (auto nameForRemoval : animsToBeRemoved)
+        m_keyframeAnimations.remove(nameForRemoval);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;RenderStyle&gt; CompositeAnimation::animate(RenderElement&amp; renderer, RenderStyle* currentStyle, RenderStyle&amp; targetStyle)
</span><span class="lines">@@ -324,40 +310,35 @@
</span><span class="cx">         // Now that we have transition objects ready, let them know about the new goal state.  We want them
</span><span class="cx">         // to fill in a RenderStyle*&amp; only if needed.
</span><span class="cx">         if (!m_transitions.isEmpty()) {
</span><del>-            CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
-            for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
-                if (ImplicitAnimation* anim = it-&gt;value.get())
-                    anim-&gt;animate(this, &amp;renderer, currentStyle, &amp;targetStyle, resultStyle);
-            }
</del><ins>+            for (auto&amp; transition : m_transitions.values())
+                transition-&gt;animate(this, &amp;renderer, currentStyle, &amp;targetStyle, resultStyle);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Now that we have animation objects ready, let them know about the new goal state.  We want them
</span><span class="cx">     // to fill in a RenderStyle*&amp; only if needed.
</span><del>-    for (Vector&lt;AtomicStringImpl*&gt;::const_iterator it = m_keyframeAnimationOrderMap.begin(); it != m_keyframeAnimationOrderMap.end(); ++it) {
-        RefPtr&lt;KeyframeAnimation&gt; keyframeAnim = m_keyframeAnimations.get(*it);
</del><ins>+    for (auto&amp; name : m_keyframeAnimationOrderMap) {
+        RefPtr&lt;KeyframeAnimation&gt; keyframeAnim = m_keyframeAnimations.get(name);
</ins><span class="cx">         if (keyframeAnim)
</span><span class="cx">             keyframeAnim-&gt;animate(this, &amp;renderer, currentStyle, &amp;targetStyle, resultStyle);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (resultStyle)
</span><span class="cx">         return resultStyle.releaseNonNull();
</span><ins>+
</ins><span class="cx">     return targetStyle;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;RenderStyle&gt; CompositeAnimation::getAnimatedStyle() const
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;RenderStyle&gt; resultStyle;
</span><del>-    CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
-    for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
-        if (ImplicitAnimation* implicitAnimation = it-&gt;value.get())
-            implicitAnimation-&gt;getAnimatedStyle(resultStyle);
-    }
</del><ins>+    for (auto&amp; transition : m_transitions.values())
+        transition-&gt;getAnimatedStyle(resultStyle);
</ins><span class="cx"> 
</span><span class="cx">     m_keyframeAnimations.checkConsistency();
</span><span class="cx"> 
</span><del>-    for (Vector&lt;AtomicStringImpl*&gt;::const_iterator it = m_keyframeAnimationOrderMap.begin(); it != m_keyframeAnimationOrderMap.end(); ++it) {
-        RefPtr&lt;KeyframeAnimation&gt; keyframeAnimation = m_keyframeAnimations.get(*it);
</del><ins>+    for (auto&amp; name : m_keyframeAnimationOrderMap) {
+        RefPtr&lt;KeyframeAnimation&gt; keyframeAnimation = m_keyframeAnimations.get(name);
</ins><span class="cx">         if (keyframeAnimation)
</span><span class="cx">             keyframeAnimation-&gt;getAnimatedStyle(resultStyle);
</span><span class="cx">     }
</span><span class="lines">@@ -372,10 +353,8 @@
</span><span class="cx">     double minT = -1;
</span><span class="cx">     
</span><span class="cx">     if (!m_transitions.isEmpty()) {
</span><del>-        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
-        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
-            ImplicitAnimation* transition = it-&gt;value.get();
-            double t = transition ? transition-&gt;timeToNextService() : -1;
</del><ins>+        for (auto&amp; transition : m_transitions.values()) {
+            double t = transition-&gt;timeToNextService();
</ins><span class="cx">             if (t &lt; minT || minT == -1)
</span><span class="cx">                 minT = t;
</span><span class="cx">             if (minT == 0)
</span><span class="lines">@@ -384,10 +363,8 @@
</span><span class="cx">     }
</span><span class="cx">     if (!m_keyframeAnimations.isEmpty()) {
</span><span class="cx">         m_keyframeAnimations.checkConsistency();
</span><del>-        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
-        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
-            KeyframeAnimation* animation = it-&gt;value.get();
-            double t = animation ? animation-&gt;timeToNextService() : -1;
</del><ins>+        for (auto&amp; animation : m_keyframeAnimations.values()) {
+            double t = animation-&gt;timeToNextService();
</ins><span class="cx">             if (t &lt; minT || minT == -1)
</span><span class="cx">                 minT = t;
</span><span class="cx">             if (minT == 0)
</span><span class="lines">@@ -406,11 +383,9 @@
</span><span class="cx">     // So we need to iterate through all animations
</span><span class="cx">     if (!m_keyframeAnimations.isEmpty()) {
</span><span class="cx">         m_keyframeAnimations.checkConsistency();
</span><del>-        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
-        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
-            RefPtr&lt;KeyframeAnimation&gt; anim = it-&gt;value;
-            if (anim-&gt;hasAnimationForProperty(property))
-                retval = anim;
</del><ins>+        for (auto&amp; animation : m_keyframeAnimations.values()) {
+            if (animation-&gt;hasAnimationForProperty(property))
+                retval = animation;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -422,32 +397,28 @@
</span><span class="cx">     // If more than one transition and animation affect transform, give up.
</span><span class="cx">     bool seenTransformAnimation = false;
</span><span class="cx">     
</span><del>-    for (auto&amp; it : m_keyframeAnimations) {
-        if (KeyframeAnimation* anim = it.value.get()) {
-            if (!anim-&gt;hasAnimationForProperty(CSSPropertyTransform))
-                continue;
</del><ins>+    for (auto&amp; animation : m_keyframeAnimations.values()) {
+        if (!animation-&gt;hasAnimationForProperty(CSSPropertyTransform))
+            continue;
</ins><span class="cx"> 
</span><del>-            if (seenTransformAnimation)
-                return false;
</del><ins>+        if (seenTransformAnimation)
+            return false;
</ins><span class="cx"> 
</span><del>-            seenTransformAnimation = true;
</del><ins>+        seenTransformAnimation = true;
</ins><span class="cx"> 
</span><del>-            if (!anim-&gt;computeExtentOfTransformAnimation(bounds))
-                return false;
-        }
</del><ins>+        if (!animation-&gt;computeExtentOfTransformAnimation(bounds))
+            return false;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    for (auto&amp; it : m_transitions) {
-        if (ImplicitAnimation* anim = it.value.get()) {
-            if (anim-&gt;animatingProperty() != CSSPropertyTransform || !anim-&gt;hasStyle())
-                continue;
</del><ins>+    for (auto&amp; transition : m_transitions.values()) {
+        if (transition-&gt;animatingProperty() != CSSPropertyTransform || !transition-&gt;hasStyle())
+            continue;
</ins><span class="cx"> 
</span><del>-            if (seenTransformAnimation)
-                return false;
</del><ins>+        if (seenTransformAnimation)
+            return false;
</ins><span class="cx"> 
</span><del>-            if (!anim-&gt;computeExtentOfTransformAnimation(bounds))
-                return false;
-        }
</del><ins>+        if (!transition-&gt;computeExtentOfTransformAnimation(bounds))
+            return false;
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return true;
</span><span class="lines">@@ -462,18 +433,14 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_keyframeAnimations.isEmpty()) {
</span><span class="cx">         m_keyframeAnimations.checkConsistency();
</span><del>-        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
-        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
-            if (KeyframeAnimation* anim = it-&gt;value.get())
-                anim-&gt;updatePlayState(AnimPlayStatePaused);
-        }
</del><ins>+        for (auto&amp; animation : m_keyframeAnimations.values())
+            animation-&gt;updatePlayState(AnimPlayStatePaused);
</ins><span class="cx">     }
</span><ins>+
</ins><span class="cx">     if (!m_transitions.isEmpty()) {
</span><del>-        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
-        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
-            ImplicitAnimation* anim = it-&gt;value.get();
-            if (anim &amp;&amp; anim-&gt;hasStyle())
-                anim-&gt;updatePlayState(AnimPlayStatePaused);
</del><ins>+        for (auto&amp; transition : m_transitions.values()) {
+            if (transition-&gt;hasStyle())
+                transition-&gt;updatePlayState(AnimPlayStatePaused);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -487,32 +454,26 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_keyframeAnimations.isEmpty()) {
</span><span class="cx">         m_keyframeAnimations.checkConsistency();
</span><del>-        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
-        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
-            KeyframeAnimation* anim = it-&gt;value.get();
-            if (anim &amp;&amp; anim-&gt;playStatePlaying())
-                anim-&gt;updatePlayState(AnimPlayStatePlaying);
</del><ins>+        for (auto&amp; animation : m_keyframeAnimations.values()) {
+            if (animation-&gt;playStatePlaying())
+                animation-&gt;updatePlayState(AnimPlayStatePlaying);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!m_transitions.isEmpty()) {
</span><del>-        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
-        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
-            ImplicitAnimation* anim = it-&gt;value.get();
-            if (anim &amp;&amp; anim-&gt;hasStyle())
-                anim-&gt;updatePlayState(AnimPlayStatePlaying);
</del><ins>+        for (auto&amp; transition : m_transitions.values()) {
+            if (transition-&gt;hasStyle())
+                transition-&gt;updatePlayState(AnimPlayStatePlaying);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CompositeAnimation::overrideImplicitAnimations(CSSPropertyID property)
</span><span class="cx"> {
</span><del>-    CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
</del><span class="cx">     if (!m_transitions.isEmpty()) {
</span><del>-        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
-            ImplicitAnimation* anim = it-&gt;value.get();
-            if (anim &amp;&amp; anim-&gt;animatingProperty() == property)
-                anim-&gt;setOverridden(true);
</del><ins>+        for (auto&amp; transition : m_transitions.values()) {
+            if (transition-&gt;animatingProperty() == property)
+                transition-&gt;setOverridden(true);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -520,11 +481,9 @@
</span><span class="cx"> void CompositeAnimation::resumeOverriddenImplicitAnimations(CSSPropertyID property)
</span><span class="cx"> {
</span><span class="cx">     if (!m_transitions.isEmpty()) {
</span><del>-        CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
-        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
-            ImplicitAnimation* anim = it-&gt;value.get();
-            if (anim &amp;&amp; anim-&gt;animatingProperty() == property)
-                anim-&gt;setOverridden(false);
</del><ins>+        for (auto&amp; transition : m_transitions.values()) {
+            if (transition-&gt;animatingProperty() == property)
+                transition-&gt;setOverridden(false);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -533,19 +492,15 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_keyframeAnimations.isEmpty()) {
</span><span class="cx">         m_keyframeAnimations.checkConsistency();
</span><del>-        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
-        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
-            KeyframeAnimation* anim = it-&gt;value.get();
-            if (anim &amp;&amp; anim-&gt;isAnimatingProperty(property, acceleratedOnly, runningState))
</del><ins>+        for (auto&amp; animation : m_keyframeAnimations.values()) {
+            if (animation-&gt;isAnimatingProperty(property, acceleratedOnly, runningState))
</ins><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!m_transitions.isEmpty()) {
</span><del>-        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
-        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
-            ImplicitAnimation* anim = it-&gt;value.get();
-            if (anim &amp;&amp; anim-&gt;isAnimatingProperty(property, acceleratedOnly, runningState))
</del><ins>+        for (auto&amp; transition : m_transitions.values()) {
+            if (transition-&gt;isAnimatingProperty(property, acceleratedOnly, runningState))
</ins><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -580,9 +535,8 @@
</span><span class="cx">         // This code is only used for testing, so performance is not critical here.
</span><span class="cx">         HashSet&lt;CSSPropertyID&gt; shorthandProperties = CSSPropertyAnimation::animatableShorthandsAffectingProperty(property);
</span><span class="cx">         bool anyPaused = false;
</span><del>-        HashSet&lt;CSSPropertyID&gt;::const_iterator end = shorthandProperties.end();
-        for (HashSet&lt;CSSPropertyID&gt;::const_iterator it = shorthandProperties.begin(); it != end; ++it) {
-            if (pauseTransitionAtTime(*it, t))
</del><ins>+        for (auto propertyID : shorthandProperties) {
+            if (pauseTransitionAtTime(propertyID, t))
</ins><span class="cx">                 anyPaused = true;
</span><span class="cx">         }
</span><span class="cx">         return anyPaused;
</span><span class="lines">@@ -603,23 +557,15 @@
</span><span class="cx"> {
</span><span class="cx">     unsigned count = 0;
</span><span class="cx">     
</span><del>-    if (!m_keyframeAnimations.isEmpty()) {
-        m_keyframeAnimations.checkConsistency();
-        AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
-        for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
-            KeyframeAnimation* anim = it-&gt;value.get();
-            if (anim-&gt;running())
-                ++count;
-        }
</del><ins>+    m_keyframeAnimations.checkConsistency();
+    for (auto&amp; animation : m_keyframeAnimations.values()) {
+        if (animation-&gt;running())
+            ++count;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!m_transitions.isEmpty()) {
-        CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
-        for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
-            ImplicitAnimation* anim = it-&gt;value.get();
-            if (anim-&gt;running())
-                ++count;
-        }
</del><ins>+    for (auto&amp; transition : m_transitions.values()) {
+        if (transition-&gt;running())
+            ++count;
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return count;
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCompositeAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CompositeAnimation.h (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CompositeAnimation.h        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/page/animation/CompositeAnimation.h        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -45,8 +45,9 @@
</span><span class="cx"> // A CompositeAnimation represents a collection of animations that are running
</span><span class="cx"> // on a single RenderElement, such as a number of properties transitioning at once.
</span><span class="cx"> class CompositeAnimation : public RefCounted&lt;CompositeAnimation&gt; {
</span><ins>+    WTF_MAKE_FAST_ALLOCATED;
</ins><span class="cx"> public:
</span><del>-    static Ref&lt;CompositeAnimation&gt; create(AnimationControllerPrivate* animationController)
</del><ins>+    static Ref&lt;CompositeAnimation&gt; create(AnimationControllerPrivate&amp; animationController)
</ins><span class="cx">     {
</span><span class="cx">         return adoptRef(*new CompositeAnimation(animationController));
</span><span class="cx">     };
</span><span class="lines">@@ -61,7 +62,7 @@
</span><span class="cx"> 
</span><span class="cx">     double timeToNextService() const;
</span><span class="cx">     
</span><del>-    AnimationControllerPrivate* animationController() const { return m_animationController; }
</del><ins>+    AnimationControllerPrivate&amp; animationController() const { return m_animationController; }
</ins><span class="cx"> 
</span><span class="cx">     void suspendAnimations();
</span><span class="cx">     void resumeAnimations();
</span><span class="lines">@@ -85,7 +86,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    CompositeAnimation(AnimationControllerPrivate*);
</del><ins>+    CompositeAnimation(AnimationControllerPrivate&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void updateTransitions(RenderElement*, RenderStyle* currentStyle, RenderStyle* targetStyle);
</span><span class="cx">     void updateKeyframeAnimations(RenderElement*, RenderStyle* currentStyle, RenderStyle* targetStyle);
</span><span class="lines">@@ -93,13 +94,13 @@
</span><span class="cx">     typedef HashMap&lt;int, RefPtr&lt;ImplicitAnimation&gt;&gt; CSSPropertyTransitionsMap;
</span><span class="cx">     typedef HashMap&lt;AtomicStringImpl*, RefPtr&lt;KeyframeAnimation&gt;&gt; AnimationNameMap;
</span><span class="cx"> 
</span><del>-    AnimationControllerPrivate* m_animationController;
</del><ins>+    AnimationControllerPrivate&amp; m_animationController;
</ins><span class="cx">     CSSPropertyTransitionsMap m_transitions;
</span><span class="cx">     AnimationNameMap m_keyframeAnimations;
</span><span class="cx">     Vector&lt;AtomicStringImpl*&gt; m_keyframeAnimationOrderMap;
</span><span class="cx">     bool m_suspended;
</span><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><del>-    bool m_hasScrollTriggeredAnimation;
</del><ins>+    bool m_hasScrollTriggeredAnimation { false };
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationImplicitAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -39,13 +39,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-ImplicitAnimation::ImplicitAnimation(const Animation&amp; transition, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compAnim, RenderStyle* fromStyle)
</del><ins>+ImplicitAnimation::ImplicitAnimation(Animation&amp; transition, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compAnim, RenderStyle* fromStyle)
</ins><span class="cx">     : AnimationBase(transition, renderer, compAnim)
</span><ins>+    , m_fromStyle(fromStyle)
</ins><span class="cx">     , m_transitionProperty(transition.property())
</span><span class="cx">     , m_animatingProperty(animatingProperty)
</span><del>-    , m_overridden(false)
-    , m_active(true)
-    , m_fromStyle(fromStyle)
</del><span class="cx"> {
</span><span class="cx">     ASSERT(animatingProperty != CSSPropertyInvalid);
</span><span class="cx"> }
</span><span class="lines">@@ -189,7 +187,7 @@
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">             // Schedule event handling
</span><del>-            m_compositeAnimation-&gt;animationController()-&gt;addEventToDispatch(element, eventType, propertyName, elapsedTime);
</del><ins>+            m_compositeAnimation-&gt;animationController().addEventToDispatch(element, eventType, propertyName, elapsedTime);
</ins><span class="cx"> 
</span><span class="cx">             // Restore the original (unanimated) style
</span><span class="cx">             if (eventType == eventNames().transitionendEvent &amp;&amp; element-&gt;renderer())
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationImplicitAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/ImplicitAnimation.h (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/ImplicitAnimation.h        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/page/animation/ImplicitAnimation.h        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> // for a single RenderElement.
</span><span class="cx"> class ImplicitAnimation : public AnimationBase {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;ImplicitAnimation&gt; create(const Animation&amp; animation, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compositeAnimation, RenderStyle* fromStyle)
</del><ins>+    static PassRefPtr&lt;ImplicitAnimation&gt; create(Animation&amp; animation, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compositeAnimation, RenderStyle* fromStyle)
</ins><span class="cx">     {
</span><span class="cx">         return adoptRef(new ImplicitAnimation(animation, animatingProperty, renderer, compositeAnimation, fromStyle));
</span><span class="cx">     };
</span><span class="lines">@@ -84,17 +84,18 @@
</span><span class="cx">     void checkForMatchingFilterFunctionLists();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    ImplicitAnimation(const Animation&amp;, CSSPropertyID, RenderElement*, CompositeAnimation*, RenderStyle*);
</del><ins>+    ImplicitAnimation(Animation&amp;, CSSPropertyID, RenderElement*, CompositeAnimation*, RenderStyle*);
</ins><span class="cx">     virtual ~ImplicitAnimation();
</span><span class="cx"> 
</span><ins>+    // The two styles that we are blending.
+    RefPtr&lt;RenderStyle&gt; m_fromStyle;
+    RefPtr&lt;RenderStyle&gt; m_toStyle;
+
</ins><span class="cx">     CSSPropertyID m_transitionProperty; // Transition property as specified in the RenderStyle.
</span><span class="cx">     CSSPropertyID m_animatingProperty; // Specific property for this ImplicitAnimation
</span><del>-    bool m_overridden;          // true when there is a keyframe animation that overrides the transitioning property
-    bool m_active;              // used for culling the list of transitions
</del><span class="cx"> 
</span><del>-    // The two styles that we are blending.
-    RefPtr&lt;RenderStyle&gt; m_fromStyle;
-    RefPtr&lt;RenderStyle&gt; m_toStyle;
</del><ins>+    bool m_active { true }; // Used for culling the list of transitions.
+    bool m_overridden { false }; // True when there is a keyframe animation that overrides the transitioning property
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationKeyframeAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -41,12 +41,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-KeyframeAnimation::KeyframeAnimation(const Animation&amp; animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
</del><ins>+KeyframeAnimation::KeyframeAnimation(Animation&amp; animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
</ins><span class="cx">     : AnimationBase(animation, renderer, compositeAnimation)
</span><span class="cx">     , m_keyframes(animation.name())
</span><del>-    , m_index(index)
-    , m_startEventDispatched(false)
</del><span class="cx">     , m_unanimatedStyle(unanimatedStyle)
</span><ins>+    , m_index(index)
</ins><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">@@ -157,15 +156,14 @@
</span><span class="cx"> 
</span><span class="cx">     // FIXME: we need to be more efficient about determining which keyframes we are animating between.
</span><span class="cx">     // We should cache the last pair or something.
</span><del>-    HashSet&lt;CSSPropertyID&gt;::const_iterator endProperties = m_keyframes.endProperties();
-    for (HashSet&lt;CSSPropertyID&gt;::const_iterator it = m_keyframes.beginProperties(); it != endProperties; ++it) {
</del><ins>+    for (auto propertyID : m_keyframes.properties()) {
</ins><span class="cx">         // Get the from/to styles and progress between
</span><span class="cx">         const RenderStyle* fromStyle = nullptr;
</span><span class="cx">         const RenderStyle* toStyle = nullptr;
</span><span class="cx">         double progress = 0;
</span><del>-        fetchIntervalEndpointsForProperty(*it, fromStyle, toStyle, progress);
</del><ins>+        fetchIntervalEndpointsForProperty(propertyID, fromStyle, toStyle, progress);
</ins><span class="cx"> 
</span><del>-        bool needsAnim = CSSPropertyAnimation::blendProperties(this, *it, animatedStyle.get(), fromStyle, toStyle, progress);
</del><ins>+        bool needsAnim = CSSPropertyAnimation::blendProperties(this, propertyID, animatedStyle.get(), fromStyle, toStyle, progress);
</ins><span class="cx">         if (!needsAnim)
</span><span class="cx">             // If we are running an accelerated animation, set a flag in the style
</span><span class="cx">             // to indicate it. This can be used to make sure we get an updated
</span><span class="lines">@@ -187,15 +185,14 @@
</span><span class="cx">     if (!animatedStyle)
</span><span class="cx">         animatedStyle = RenderStyle::clone(&amp;m_object-&gt;style());
</span><span class="cx"> 
</span><del>-    HashSet&lt;CSSPropertyID&gt;::const_iterator endProperties = m_keyframes.endProperties();
-    for (HashSet&lt;CSSPropertyID&gt;::const_iterator it = m_keyframes.beginProperties(); it != endProperties; ++it) {
</del><ins>+    for (auto propertyID : m_keyframes.properties()) {
</ins><span class="cx">         // Get the from/to styles and progress between
</span><span class="cx">         const RenderStyle* fromStyle = nullptr;
</span><span class="cx">         const RenderStyle* toStyle = nullptr;
</span><span class="cx">         double progress = 0;
</span><del>-        fetchIntervalEndpointsForProperty(*it, fromStyle, toStyle, progress);
</del><ins>+        fetchIntervalEndpointsForProperty(propertyID, fromStyle, toStyle, progress);
</ins><span class="cx"> 
</span><del>-        CSSPropertyAnimation::blendProperties(this, *it, animatedStyle.get(), fromStyle, toStyle, progress);
</del><ins>+        CSSPropertyAnimation::blendProperties(this, propertyID, animatedStyle.get(), fromStyle, toStyle, progress);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -211,20 +208,17 @@
</span><span class="cx"> 
</span><span class="cx">     FloatRect cumulativeBounds = bounds;
</span><span class="cx"> 
</span><del>-    size_t numKeyframes = m_keyframes.size();
-    for (size_t i = 0; i &lt; numKeyframes; ++i) {
-        const KeyframeValue&amp; currKeyFrame = m_keyframes[i];
-
-        if (!currKeyFrame.containsProperty(CSSPropertyTransform))
</del><ins>+    for (auto&amp; keyframe : m_keyframes.keyframes()) {
+        if (!keyframe.containsProperty(CSSPropertyTransform))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         LayoutRect keyframeBounds = bounds;
</span><span class="cx">         
</span><span class="cx">         bool canCompute;
</span><span class="cx">         if (isTransformFunctionListValid())
</span><del>-            canCompute = computeTransformedExtentViaTransformList(rendererBox, *currKeyFrame.style(), keyframeBounds);
</del><ins>+            canCompute = computeTransformedExtentViaTransformList(rendererBox, *keyframe.style(), keyframeBounds);
</ins><span class="cx">         else
</span><del>-            canCompute = computeTransformedExtentViaMatrix(rendererBox, *currKeyFrame.style(), keyframeBounds);
</del><ins>+            canCompute = computeTransformedExtentViaMatrix(rendererBox, *keyframe.style(), keyframeBounds);
</ins><span class="cx">         
</span><span class="cx">         if (!canCompute)
</span><span class="cx">             return false;
</span><span class="lines">@@ -244,7 +238,7 @@
</span><span class="cx"> bool KeyframeAnimation::startAnimation(double timeOffset)
</span><span class="cx"> {
</span><span class="cx">     if (m_object &amp;&amp; m_object-&gt;isComposited())
</span><del>-        return downcast&lt;RenderBoxModelObject&gt;(*m_object).startAnimation(timeOffset, m_animation.get(), m_keyframes);
</del><ins>+        return downcast&lt;RenderBoxModelObject&gt;(*m_object).startAnimation(timeOffset, m_animation.ptr(), m_keyframes);
</ins><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -322,7 +316,7 @@
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="cx">         // Schedule event handling
</span><del>-        m_compositeAnimation-&gt;animationController()-&gt;addEventToDispatch(element, eventType, m_keyframes.animationName(), elapsedTime);
</del><ins>+        m_compositeAnimation-&gt;animationController().addEventToDispatch(element, eventType, m_keyframes.animationName(), elapsedTime);
</ins><span class="cx"> 
</span><span class="cx">         // Restore the original (unanimated) style
</span><span class="cx">         if ((eventType == eventNames().webkitAnimationEndEvent || eventType == eventNames().animationendEvent) &amp;&amp; element-&gt;renderer())
</span><span class="lines">@@ -337,17 +331,15 @@
</span><span class="cx"> void KeyframeAnimation::overrideAnimations()
</span><span class="cx"> {
</span><span class="cx">     // This will override implicit animations that match the properties in the keyframe animation
</span><del>-    HashSet&lt;CSSPropertyID&gt;::const_iterator end = m_keyframes.endProperties();
-    for (HashSet&lt;CSSPropertyID&gt;::const_iterator it = m_keyframes.beginProperties(); it != end; ++it)
-        compositeAnimation()-&gt;overrideImplicitAnimations(*it);
</del><ins>+    for (auto propertyID : m_keyframes.properties())
+        compositeAnimation()-&gt;overrideImplicitAnimations(propertyID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void KeyframeAnimation::resumeOverriddenAnimations()
</span><span class="cx"> {
</span><span class="cx">     // This will resume overridden implicit animations
</span><del>-    HashSet&lt;CSSPropertyID&gt;::const_iterator end = m_keyframes.endProperties();
-    for (HashSet&lt;CSSPropertyID&gt;::const_iterator it = m_keyframes.beginProperties(); it != end; ++it)
-        compositeAnimation()-&gt;resumeOverriddenImplicitAnimations(*it);
</del><ins>+    for (auto propertyID : m_keyframes.properties())
+        compositeAnimation()-&gt;resumeOverriddenImplicitAnimations(propertyID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool KeyframeAnimation::affectsProperty(CSSPropertyID property) const
</span><span class="lines">@@ -447,11 +439,10 @@
</span><span class="cx">         
</span><span class="cx">     // A return value of 0 means we need service. But if we only have accelerated animations we 
</span><span class="cx">     // only need service at the end of the transition
</span><del>-    HashSet&lt;CSSPropertyID&gt;::const_iterator endProperties = m_keyframes.endProperties();
</del><span class="cx">     bool acceleratedPropertiesOnly = true;
</span><span class="cx">     
</span><del>-    for (HashSet&lt;CSSPropertyID&gt;::const_iterator it = m_keyframes.beginProperties(); it != endProperties; ++it) {
-        if (!CSSPropertyAnimation::animationOfPropertyIsAccelerated(*it) || !isAccelerated()) {
</del><ins>+    for (auto propertyID : m_keyframes.properties()) {
+        if (!CSSPropertyAnimation::animationOfPropertyIsAccelerated(propertyID) || !isAccelerated()) {
</ins><span class="cx">             acceleratedPropertiesOnly = false;
</span><span class="cx">             break;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationKeyframeAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/KeyframeAnimation.h (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/KeyframeAnimation.h        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/page/animation/KeyframeAnimation.h        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -40,7 +40,7 @@
</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 RefPtr&lt;KeyframeAnimation&gt; create(const Animation&amp; animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
</del><ins>+    static RefPtr&lt;KeyframeAnimation&gt; create(Animation&amp; animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
</ins><span class="cx">     {
</span><span class="cx">         return adoptRef(new KeyframeAnimation(animation, renderer, index, compositeAnimation, unanimatedStyle));
</span><span class="cx">     }
</span><span class="lines">@@ -87,21 +87,17 @@
</span><span class="cx">     void checkForMatchingFilterFunctionLists();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    KeyframeAnimation(const Animation&amp;, RenderElement*, int index, CompositeAnimation*, RenderStyle* unanimatedStyle);
</del><ins>+    KeyframeAnimation(Animation&amp;, RenderElement*, int index, 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="cx">     void fetchIntervalEndpointsForProperty(CSSPropertyID, const RenderStyle*&amp; fromStyle, const RenderStyle*&amp; toStyle, double&amp; progress) const;
</span><span class="cx"> 
</span><del>-    // The keyframes that we are blending.
</del><span class="cx">     KeyframeList m_keyframes;
</span><ins>+    RefPtr&lt;RenderStyle&gt; m_unanimatedStyle; // The style just before we started animation
</ins><span class="cx"> 
</span><del>-    // The order in which this animation appears in the animation-name style.
-    int m_index;
-    bool m_startEventDispatched;
-
-    // The style just before we started animation
-    RefPtr&lt;RenderStyle&gt; m_unanimatedStyle;
</del><ins>+    int m_index; // The order in which this animation appears in the animation-name style.
+    bool m_startEventDispatched { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformanimationAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/animation/Animation.cpp (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/animation/Animation.cpp        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/platform/animation/Animation.cpp        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -125,40 +125,37 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Animation::animationsMatch(const Animation* o, bool matchPlayStates) const
</del><ins>+bool Animation::animationsMatch(const Animation&amp; other, bool matchPlayStates) const
</ins><span class="cx"> {
</span><del>-    if (!o)
-        return false;
-    
-    bool result = m_name == o-&gt;m_name
-                  &amp;&amp; m_property == o-&gt;m_property 
-                  &amp;&amp; m_mode == o-&gt;m_mode
-                  &amp;&amp; m_iterationCount == o-&gt;m_iterationCount
-                  &amp;&amp; m_delay == o-&gt;m_delay
-                  &amp;&amp; m_duration == o-&gt;m_duration
-                  &amp;&amp; *(m_timingFunction.get()) == *(o-&gt;m_timingFunction.get())
</del><ins>+    bool result = m_name == other.m_name
+        &amp;&amp; m_property == other.m_property
+        &amp;&amp; m_mode == other.m_mode
+        &amp;&amp; m_iterationCount == other.m_iterationCount
+        &amp;&amp; m_delay == other.m_delay
+        &amp;&amp; m_duration == other.m_duration
+        &amp;&amp; *(m_timingFunction.get()) == *(other.m_timingFunction.get())
</ins><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><del>-                  &amp;&amp; *(m_trigger.get()) == *(o-&gt;m_trigger.get())
</del><ins>+        &amp;&amp; *(m_trigger.get()) == *(other.m_trigger.get())
</ins><span class="cx"> #endif
</span><del>-                  &amp;&amp; m_direction == o-&gt;m_direction
-                  &amp;&amp; m_fillMode == o-&gt;m_fillMode
-                  &amp;&amp; m_delaySet == o-&gt;m_delaySet
-                  &amp;&amp; m_directionSet == o-&gt;m_directionSet
-                  &amp;&amp; m_durationSet == o-&gt;m_durationSet
-                  &amp;&amp; m_fillModeSet == o-&gt;m_fillModeSet
-                  &amp;&amp; m_iterationCountSet == o-&gt;m_iterationCountSet
-                  &amp;&amp; m_nameSet == o-&gt;m_nameSet
-                  &amp;&amp; m_propertySet == o-&gt;m_propertySet
-                  &amp;&amp; m_timingFunctionSet == o-&gt;m_timingFunctionSet
</del><ins>+        &amp;&amp; m_direction == other.m_direction
+        &amp;&amp; m_fillMode == other.m_fillMode
+        &amp;&amp; m_delaySet == other.m_delaySet
+        &amp;&amp; m_directionSet == other.m_directionSet
+        &amp;&amp; m_durationSet == other.m_durationSet
+        &amp;&amp; m_fillModeSet == other.m_fillModeSet
+        &amp;&amp; m_iterationCountSet == other.m_iterationCountSet
+        &amp;&amp; m_nameSet == other.m_nameSet
+        &amp;&amp; m_propertySet == other.m_propertySet
+        &amp;&amp; m_timingFunctionSet == other.m_timingFunctionSet
</ins><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><del>-                  &amp;&amp; m_triggerSet == o-&gt;m_triggerSet
</del><ins>+        &amp;&amp; m_triggerSet == other.m_triggerSet
</ins><span class="cx"> #endif
</span><del>-                  &amp;&amp; m_isNone == o-&gt;m_isNone;
</del><ins>+        &amp;&amp; m_isNone == other.m_isNone;
</ins><span class="cx"> 
</span><span class="cx">     if (!result)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    return !matchPlayStates || (m_playState == o-&gt;m_playState &amp;&amp; m_playStateSet == o-&gt;m_playStateSet);
</del><ins>+    return !matchPlayStates || (m_playState == other.m_playState &amp;&amp; m_playStateSet == other.m_playStateSet);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const String&amp; Animation::initialName()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformanimationAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/animation/Animation.h (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/animation/Animation.h        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/platform/animation/Animation.h        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -160,10 +160,10 @@
</span><span class="cx">     Animation&amp; operator=(const Animation&amp; o);
</span><span class="cx"> 
</span><span class="cx">     // return true if all members of this class match (excluding m_next)
</span><del>-    bool animationsMatch(const Animation*, bool matchPlayStates = true) const;
</del><ins>+    bool animationsMatch(const Animation&amp;, bool matchPlayStates = true) const;
</ins><span class="cx"> 
</span><span class="cx">     // return true every Animation in the chain (defined by m_next) match 
</span><del>-    bool operator==(const Animation&amp; o) const { return animationsMatch(&amp;o); }
</del><ins>+    bool operator==(const Animation&amp; o) const { return animationsMatch(o); }
</ins><span class="cx">     bool operator!=(const Animation&amp; o) const { return !(*this == o); }
</span><span class="cx"> 
</span><span class="cx">     bool fillsBackwards() const { return m_fillModeSet &amp;&amp; (m_fillMode == AnimationFillModeBackwards || m_fillMode == AnimationFillModeBoth); }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -3750,8 +3750,8 @@
</span><span class="cx">     LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, subpixelAccumulation, subtreePaintRoot, &amp;overlapTestRequests);
</span><span class="cx">     paintLayer(context, paintingInfo, paintFlags);
</span><span class="cx"> 
</span><del>-    for (auto it : overlapTestRequests)
-        it.key-&gt;setOverlapTestResult(false);
</del><ins>+    for (auto&amp; widget : overlapTestRequests.keys())
+        widget-&gt;setOverlapTestResult(false);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderLayer::paintOverlayScrollbars(GraphicsContext* context, const LayoutRect&amp; damageRect, PaintBehavior paintBehavior, RenderObject* subtreePaintRoot)
</span><span class="lines">@@ -3820,12 +3820,12 @@
</span><span class="cx"> {
</span><span class="cx">     Vector&lt;OverlapTestRequestClient*&gt; overlappedRequestClients;
</span><span class="cx">     LayoutRect boundingBox = layer-&gt;boundingBox(rootLayer, layer-&gt;offsetFromAncestor(rootLayer));
</span><del>-    for (auto it : overlapTestRequests) {
-        if (!boundingBox.intersects(it.value))
</del><ins>+    for (auto&amp; request : overlapTestRequests) {
+        if (!boundingBox.intersects(request.value))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        it.key-&gt;setOverlapTestResult(true);
-        overlappedRequestClients.append(it.key);
</del><ins>+        request.key-&gt;setOverlapTestResult(true);
+        overlappedRequestClients.append(request.key);
</ins><span class="cx">     }
</span><span class="cx">     for (auto client : overlappedRequestClients)
</span><span class="cx">         overlapTestRequests.remove(client);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleKeyframeListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/KeyframeList.h (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/KeyframeList.h        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/rendering/style/KeyframeList.h        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -82,13 +82,13 @@
</span><span class="cx">     
</span><span class="cx">     void addProperty(CSSPropertyID prop) { m_properties.add(prop); }
</span><span class="cx">     bool containsProperty(CSSPropertyID prop) const { return m_properties.contains(prop); }
</span><del>-    HashSet&lt;CSSPropertyID&gt;::const_iterator beginProperties() const { return m_properties.begin(); }
-    HashSet&lt;CSSPropertyID&gt;::const_iterator endProperties() const { return m_properties.end(); }
</del><ins>+    const HashSet&lt;CSSPropertyID&gt;&amp; properties() const { return m_properties; }
</ins><span class="cx">     
</span><span class="cx">     void clear();
</span><span class="cx">     bool isEmpty() const { return m_keyframes.isEmpty(); }
</span><span class="cx">     size_t size() const { return m_keyframes.size(); }
</span><span class="cx">     const KeyframeValue&amp; operator[](size_t index) const { return m_keyframes[index]; }
</span><ins>+    const Vector&lt;KeyframeValue&gt;&amp; keyframes() const { return m_keyframes; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     AtomicString m_animationName;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (183363 => 183364)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2015-04-26 20:36:09 UTC (rev 183363)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2015-04-26 20:38:20 UTC (rev 183364)
</span><span class="lines">@@ -1060,6 +1060,9 @@
</span><span class="cx">     const AnimationList* animations() const { return rareNonInheritedData-&gt;m_animations.get(); }
</span><span class="cx">     const AnimationList* transitions() const { return rareNonInheritedData-&gt;m_transitions.get(); }
</span><span class="cx"> 
</span><ins>+    AnimationList* animations() { return rareNonInheritedData-&gt;m_animations.get(); }
+    AnimationList* transitions() { return rareNonInheritedData-&gt;m_transitions.get(); }
+
</ins><span class="cx">     AnimationList&amp; ensureAnimations();
</span><span class="cx">     AnimationList&amp; ensureTransitions();
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>