<!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 <simon.fraser@apple.com>
+
+ 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 <simon.fraser@apple.com>
</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& 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<Animation*>(&transition))
</del><ins>+AnimationBase::AnimationBase(Animation& 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->iterationCount() > 0)
</span><span class="lines">@@ -106,9 +97,9 @@
</span><span class="cx"> return m_animation->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& animation) const
</ins><span class="cx"> {
</span><del>- return m_animation->animationsMatch(anim);
</del><ins>+ return m_animation->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->animationController()->removeFromAnimationsWaitingForStyle(this);
</del><ins>+ m_compositeAnimation->animationController().removeFromAnimationsWaitingForStyle(this);
</ins><span class="cx"> LOG(Animations, "%p AnimationState %s -> New", 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->animationController()->removeFromAnimationsWaitingForStyle(this);
</del><ins>+ m_compositeAnimation->animationController().removeFromAnimationsWaitingForStyle(this);
</ins><span class="cx"> LOG(Animations, "%p AnimationState %s -> New", 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->animationController()->removeFromAnimationsWaitingForStyle(this);
</del><ins>+ m_compositeAnimation->animationController().removeFromAnimationsWaitingForStyle(this);
</ins><span class="cx"> LOG(Animations, "%p AnimationState %s -> Done", 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->trigger() && m_animation->trigger()->isScrollAnimationTrigger())
</span><del>- m_compositeAnimation->animationController()->addToAnimationsDependentOnScroll(this);
</del><ins>+ m_compositeAnimation->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, "%p AnimationState %s -> StartWaitStyleAvailable", this, nameForState(m_animationState));
</span><span class="cx"> m_animationState = AnimationState::StartWaitStyleAvailable;
</span><del>- m_compositeAnimation->animationController()->addToAnimationsWaitingForStyle(this);
</del><ins>+ m_compositeAnimation->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 && m_object->element())
</span><del>- m_compositeAnimation->animationController()->addElementChangeToDispatch(*m_object->element());
</del><ins>+ m_compositeAnimation->animationController().addElementChangeToDispatch(*m_object->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->delay();
</span><span class="cx"> bool started = startAnimation(timeOffset);
</span><span class="cx">
</span><del>- m_compositeAnimation->animationController()->addToAnimationsWaitingForStartTimeResponse(this, started);
</del><ins>+ m_compositeAnimation->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 && m_object->element())
</span><del>- m_compositeAnimation->animationController()->addElementChangeToDispatch(*m_object->element());
</del><ins>+ m_compositeAnimation->animationController().addElementChangeToDispatch(*m_object->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->element())
</span><del>- m_compositeAnimation->animationController()->addElementChangeToDispatch(*m_object->element());
</del><ins>+ m_compositeAnimation->animationController().addElementChangeToDispatch(*m_object->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->animationController()->addToAnimationsWaitingForStartTimeResponse(this, started);
</del><ins>+ m_compositeAnimation->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->trigger() && m_animation->trigger()->isScrollAnimationTrigger()) {
</span><span class="cx"> if (m_object) {
</span><del>- float offset = m_compositeAnimation->animationController()->scrollPosition();
</del><ins>+ float offset = m_compositeAnimation->animationController().scrollPosition();
</ins><span class="cx"> ScrollAnimationTrigger& scrollTrigger = downcast<ScrollAnimationTrigger>(*m_animation->trigger().get());
</span><span class="cx"> if (offset > 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->animationController()->beginAnimationUpdateTime();
</del><ins>+ return m_compositeAnimation->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->trigger() && m_animation->trigger()->isScrollAnimationTrigger()) {
</span><span class="cx"> ScrollAnimationTrigger& scrollTrigger = downcast<ScrollAnimationTrigger>(*m_animation->trigger().get());
</span><span class="cx"> if (scrollTrigger.hasEndValue() && m_object) {
</span><del>- float offset = m_compositeAnimation->animationController()->scrollPosition();
</del><ins>+ float offset = m_compositeAnimation->animationController().scrollPosition();
</ins><span class="cx"> float startValue = scrollTrigger.startValue().value();
</span><span class="cx"> if (offset < 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<AnimationBase> {
</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& transition, RenderElement*, CompositeAnimation*);
</del><ins>+ AnimationBase(Animation& 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&) const;
</ins><span class="cx">
</span><del>- void setAnimation(const Animation& animation) { m_animation = const_cast<Animation*>(&animation); }
</del><ins>+ const Animation& animation() const { return m_animation; }
+ void setAnimation(Animation& 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& 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& rendererBox, const RenderStyle&, LayoutRect& bounds) const;
</span><span class="cx"> bool computeTransformedExtentViaMatrix(const FloatRect& rendererBox, const RenderStyle&, LayoutRect& 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<Animation> m_animation;
</ins><span class="cx">
</span><del>- RefPtr<Animation> 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(&renderer, nullptr);
</span><span class="cx"> if (result.isNewEntry) {
</span><del>- result.iterator->value = CompositeAnimation::create(this);
</del><ins>+ result.iterator->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& 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->isSuspended() && !animationController->allowsNewAnimationsWhileSuspended();
</del><ins>+ m_suspended = m_animationController.isSuspended() && !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->value.get();
- animationController()->animationWillBeRemoved(transition);
</del><ins>+ for (auto& transition : m_transitions.values()) {
+ animationController().animationWillBeRemoved(transition.get());
</ins><span class="cx"> transition->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->value.get();
- animationController()->animationWillBeRemoved(anim);
- anim->clear();
</del><ins>+ for (auto& animation : m_keyframeAnimations.values()) {
+ animationController().animationWillBeRemoved(animation.get());
+ animation->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->value->setActive(false);
</del><ins>+ for (auto& transition : m_transitions.values())
+ transition->setActive(false);
</ins><span class="cx">
</span><span class="cx"> RefPtr<RenderStyle> 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->transitions()) {
</span><span class="cx"> for (size_t i = 0; i < targetStyle->transitions()->size(); ++i) {
</span><del>- const Animation& animation = targetStyle->transitions()->animation(i);
</del><ins>+ Animation& animation = targetStyle->transitions()->animation(i);
</ins><span class="cx"> bool isActiveTransition = !m_suspended && (animation.duration() || animation.delay() > 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->blendPropertyValueInStyle(prop, modifiedCurrentStyle.get());
</span><span class="cx"> }
</span><span class="cx"> LOG(Animations, "Removing existing ImplicitAnimation %p for property %s", implAnim, getPropertyName(prop));
</span><del>- animationController()->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<int> toBeRemoved;
</span><del>- end = m_transitions.end();
- for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
- ImplicitAnimation* anim = it->value.get();
- if (!anim->active()) {
- animationController()->animationWillBeRemoved(anim);
- toBeRemoved.append(anim->animatingProperty());
- LOG(Animations, "Removing ImplicitAnimation %p for property %s", anim, getPropertyName(anim->animatingProperty()));
</del><ins>+ for (auto& transition : m_transitions.values()) {
+ if (!transition->active()) {
+ animationController().animationWillBeRemoved(transition.get());
+ toBeRemoved.append(transition->animatingProperty());
+ LOG(Animations, "Removing ImplicitAnimation %p for property %s", transition.get(), getPropertyName(transition->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 < 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 && currentStyle->hasAnimations() && targetStyle->hasAnimations() && *(currentStyle->animations()) == *(targetStyle->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->value->postActive())
- it->value->setIndex(-1);
</del><ins>+ for (auto& animation : m_keyframeAnimations.values()) {
+ if (animation->postActive())
+ animation->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->value->setIndex(-1);
</del><ins>+ for (auto& animation : m_keyframeAnimations.values())
+ animation->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->animations()) {
</span><span class="cx"> int numAnims = targetStyle->animations()->size();
</span><span class="cx"> for (int i = 0; i < numAnims; ++i) {
</span><del>- const Animation& animation = targetStyle->animations()->animation(i);
</del><ins>+ Animation& animation = targetStyle->animations()->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, " (created in suspended/paused state)");
</span><span class="cx"> }
</span><span class="cx"> #if !LOG_DISABLED
</span><del>- for (auto it = keyframeAnim->keyframes().beginProperties(), end = keyframeAnim->keyframes().endProperties(); it != end; ++it)
- LOG(Animations, " property %s", getPropertyName(*it));
</del><ins>+ for (auto propertyID : keyframeAnim->keyframes().properties())
+ LOG(Animations, " property %s", getPropertyName(propertyID));
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><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<AtomicStringImpl*> animsToBeRemoved;
</span><del>- kfend = m_keyframeAnimations.end();
- for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != kfend; ++it) {
- KeyframeAnimation* keyframeAnim = it->value.get();
- if (keyframeAnim->index() < 0) {
- animsToBeRemoved.append(keyframeAnim->name().impl());
- animationController()->animationWillBeRemoved(keyframeAnim);
- keyframeAnim->clear();
- LOG(Animations, "Removing KeyframeAnimation %p", keyframeAnim);
</del><ins>+ for (auto& animation : m_keyframeAnimations.values()) {
+ if (animation->index() < 0) {
+ animsToBeRemoved.append(animation->name().impl());
+ animationController().animationWillBeRemoved(animation.get());
+ animation->clear();
+ LOG(Animations, "Removing KeyframeAnimation %p", 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 < 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<RenderStyle> CompositeAnimation::animate(RenderElement& renderer, RenderStyle* currentStyle, RenderStyle& 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*& 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->value.get())
- anim->animate(this, &renderer, currentStyle, &targetStyle, resultStyle);
- }
</del><ins>+ for (auto& transition : m_transitions.values())
+ transition->animate(this, &renderer, currentStyle, &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*& only if needed.
</span><del>- for (Vector<AtomicStringImpl*>::const_iterator it = m_keyframeAnimationOrderMap.begin(); it != m_keyframeAnimationOrderMap.end(); ++it) {
- RefPtr<KeyframeAnimation> keyframeAnim = m_keyframeAnimations.get(*it);
</del><ins>+ for (auto& name : m_keyframeAnimationOrderMap) {
+ RefPtr<KeyframeAnimation> keyframeAnim = m_keyframeAnimations.get(name);
</ins><span class="cx"> if (keyframeAnim)
</span><span class="cx"> keyframeAnim->animate(this, &renderer, currentStyle, &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<RenderStyle> CompositeAnimation::getAnimatedStyle() const
</span><span class="cx"> {
</span><span class="cx"> RefPtr<RenderStyle> 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->value.get())
- implicitAnimation->getAnimatedStyle(resultStyle);
- }
</del><ins>+ for (auto& transition : m_transitions.values())
+ transition->getAnimatedStyle(resultStyle);
</ins><span class="cx">
</span><span class="cx"> m_keyframeAnimations.checkConsistency();
</span><span class="cx">
</span><del>- for (Vector<AtomicStringImpl*>::const_iterator it = m_keyframeAnimationOrderMap.begin(); it != m_keyframeAnimationOrderMap.end(); ++it) {
- RefPtr<KeyframeAnimation> keyframeAnimation = m_keyframeAnimations.get(*it);
</del><ins>+ for (auto& name : m_keyframeAnimationOrderMap) {
+ RefPtr<KeyframeAnimation> keyframeAnimation = m_keyframeAnimations.get(name);
</ins><span class="cx"> if (keyframeAnimation)
</span><span class="cx"> keyframeAnimation->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->value.get();
- double t = transition ? transition->timeToNextService() : -1;
</del><ins>+ for (auto& transition : m_transitions.values()) {
+ double t = transition->timeToNextService();
</ins><span class="cx"> if (t < 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->value.get();
- double t = animation ? animation->timeToNextService() : -1;
</del><ins>+ for (auto& animation : m_keyframeAnimations.values()) {
+ double t = animation->timeToNextService();
</ins><span class="cx"> if (t < 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<KeyframeAnimation> anim = it->value;
- if (anim->hasAnimationForProperty(property))
- retval = anim;
</del><ins>+ for (auto& animation : m_keyframeAnimations.values()) {
+ if (animation->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& it : m_keyframeAnimations) {
- if (KeyframeAnimation* anim = it.value.get()) {
- if (!anim->hasAnimationForProperty(CSSPropertyTransform))
- continue;
</del><ins>+ for (auto& animation : m_keyframeAnimations.values()) {
+ if (!animation->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->computeExtentOfTransformAnimation(bounds))
- return false;
- }
</del><ins>+ if (!animation->computeExtentOfTransformAnimation(bounds))
+ return false;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- for (auto& it : m_transitions) {
- if (ImplicitAnimation* anim = it.value.get()) {
- if (anim->animatingProperty() != CSSPropertyTransform || !anim->hasStyle())
- continue;
</del><ins>+ for (auto& transition : m_transitions.values()) {
+ if (transition->animatingProperty() != CSSPropertyTransform || !transition->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->computeExtentOfTransformAnimation(bounds))
- return false;
- }
</del><ins>+ if (!transition->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->value.get())
- anim->updatePlayState(AnimPlayStatePaused);
- }
</del><ins>+ for (auto& animation : m_keyframeAnimations.values())
+ animation->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->value.get();
- if (anim && anim->hasStyle())
- anim->updatePlayState(AnimPlayStatePaused);
</del><ins>+ for (auto& transition : m_transitions.values()) {
+ if (transition->hasStyle())
+ transition->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->value.get();
- if (anim && anim->playStatePlaying())
- anim->updatePlayState(AnimPlayStatePlaying);
</del><ins>+ for (auto& animation : m_keyframeAnimations.values()) {
+ if (animation->playStatePlaying())
+ animation->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->value.get();
- if (anim && anim->hasStyle())
- anim->updatePlayState(AnimPlayStatePlaying);
</del><ins>+ for (auto& transition : m_transitions.values()) {
+ if (transition->hasStyle())
+ transition->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->value.get();
- if (anim && anim->animatingProperty() == property)
- anim->setOverridden(true);
</del><ins>+ for (auto& transition : m_transitions.values()) {
+ if (transition->animatingProperty() == property)
+ transition->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->value.get();
- if (anim && anim->animatingProperty() == property)
- anim->setOverridden(false);
</del><ins>+ for (auto& transition : m_transitions.values()) {
+ if (transition->animatingProperty() == property)
+ transition->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->value.get();
- if (anim && anim->isAnimatingProperty(property, acceleratedOnly, runningState))
</del><ins>+ for (auto& animation : m_keyframeAnimations.values()) {
+ if (animation->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->value.get();
- if (anim && anim->isAnimatingProperty(property, acceleratedOnly, runningState))
</del><ins>+ for (auto& transition : m_transitions.values()) {
+ if (transition->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<CSSPropertyID> shorthandProperties = CSSPropertyAnimation::animatableShorthandsAffectingProperty(property);
</span><span class="cx"> bool anyPaused = false;
</span><del>- HashSet<CSSPropertyID>::const_iterator end = shorthandProperties.end();
- for (HashSet<CSSPropertyID>::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->value.get();
- if (anim->running())
- ++count;
- }
</del><ins>+ m_keyframeAnimations.checkConsistency();
+ for (auto& animation : m_keyframeAnimations.values()) {
+ if (animation->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->value.get();
- if (anim->running())
- ++count;
- }
</del><ins>+ for (auto& transition : m_transitions.values()) {
+ if (transition->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<CompositeAnimation> {
</span><ins>+ WTF_MAKE_FAST_ALLOCATED;
</ins><span class="cx"> public:
</span><del>- static Ref<CompositeAnimation> create(AnimationControllerPrivate* animationController)
</del><ins>+ static Ref<CompositeAnimation> create(AnimationControllerPrivate& 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& 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&);
</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<int, RefPtr<ImplicitAnimation>> CSSPropertyTransitionsMap;
</span><span class="cx"> typedef HashMap<AtomicStringImpl*, RefPtr<KeyframeAnimation>> AnimationNameMap;
</span><span class="cx">
</span><del>- AnimationControllerPrivate* m_animationController;
</del><ins>+ AnimationControllerPrivate& m_animationController;
</ins><span class="cx"> CSSPropertyTransitionsMap m_transitions;
</span><span class="cx"> AnimationNameMap m_keyframeAnimations;
</span><span class="cx"> Vector<AtomicStringImpl*> 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& transition, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compAnim, RenderStyle* fromStyle)
</del><ins>+ImplicitAnimation::ImplicitAnimation(Animation& 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->animationController()->addEventToDispatch(element, eventType, propertyName, elapsedTime);
</del><ins>+ m_compositeAnimation->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 && element->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<ImplicitAnimation> create(const Animation& animation, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compositeAnimation, RenderStyle* fromStyle)
</del><ins>+ static PassRefPtr<ImplicitAnimation> create(Animation& 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&, CSSPropertyID, RenderElement*, CompositeAnimation*, RenderStyle*);
</del><ins>+ ImplicitAnimation(Animation&, CSSPropertyID, RenderElement*, CompositeAnimation*, RenderStyle*);
</ins><span class="cx"> virtual ~ImplicitAnimation();
</span><span class="cx">
</span><ins>+ // The two styles that we are blending.
+ RefPtr<RenderStyle> m_fromStyle;
+ RefPtr<RenderStyle> 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<RenderStyle> m_fromStyle;
- RefPtr<RenderStyle> 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& animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
</del><ins>+KeyframeAnimation::KeyframeAnimation(Animation& 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 && m_object->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<CSSPropertyID>::const_iterator endProperties = m_keyframes.endProperties();
- for (HashSet<CSSPropertyID>::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(&m_object->style());
</span><span class="cx">
</span><del>- HashSet<CSSPropertyID>::const_iterator endProperties = m_keyframes.endProperties();
- for (HashSet<CSSPropertyID>::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 < numKeyframes; ++i) {
- const KeyframeValue& currKeyFrame = m_keyframes[i];
-
- if (!currKeyFrame.containsProperty(CSSPropertyTransform))
</del><ins>+ for (auto& 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 && m_object->isComposited())
</span><del>- return downcast<RenderBoxModelObject>(*m_object).startAnimation(timeOffset, m_animation.get(), m_keyframes);
</del><ins>+ return downcast<RenderBoxModelObject>(*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->animationController()->addEventToDispatch(element, eventType, m_keyframes.animationName(), elapsedTime);
</del><ins>+ m_compositeAnimation->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) && element->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<CSSPropertyID>::const_iterator end = m_keyframes.endProperties();
- for (HashSet<CSSPropertyID>::const_iterator it = m_keyframes.beginProperties(); it != end; ++it)
- compositeAnimation()->overrideImplicitAnimations(*it);
</del><ins>+ for (auto propertyID : m_keyframes.properties())
+ compositeAnimation()->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<CSSPropertyID>::const_iterator end = m_keyframes.endProperties();
- for (HashSet<CSSPropertyID>::const_iterator it = m_keyframes.beginProperties(); it != end; ++it)
- compositeAnimation()->resumeOverriddenImplicitAnimations(*it);
</del><ins>+ for (auto propertyID : m_keyframes.properties())
+ compositeAnimation()->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<CSSPropertyID>::const_iterator endProperties = m_keyframes.endProperties();
</del><span class="cx"> bool acceleratedPropertiesOnly = true;
</span><span class="cx">
</span><del>- for (HashSet<CSSPropertyID>::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<KeyframeAnimation> create(const Animation& animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
</del><ins>+ static RefPtr<KeyframeAnimation> create(Animation& 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&, RenderElement*, int index, CompositeAnimation*, RenderStyle* unanimatedStyle);
</del><ins>+ KeyframeAnimation(Animation&, 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*& fromStyle, const RenderStyle*& toStyle, double& progress) const;
</span><span class="cx">
</span><del>- // The keyframes that we are blending.
</del><span class="cx"> KeyframeList m_keyframes;
</span><ins>+ RefPtr<RenderStyle> 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<RenderStyle> 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& other, bool matchPlayStates) const
</ins><span class="cx"> {
</span><del>- if (!o)
- return false;
-
- bool result = m_name == o->m_name
- && m_property == o->m_property
- && m_mode == o->m_mode
- && m_iterationCount == o->m_iterationCount
- && m_delay == o->m_delay
- && m_duration == o->m_duration
- && *(m_timingFunction.get()) == *(o->m_timingFunction.get())
</del><ins>+ bool result = m_name == other.m_name
+ && m_property == other.m_property
+ && m_mode == other.m_mode
+ && m_iterationCount == other.m_iterationCount
+ && m_delay == other.m_delay
+ && m_duration == other.m_duration
+ && *(m_timingFunction.get()) == *(other.m_timingFunction.get())
</ins><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><del>- && *(m_trigger.get()) == *(o->m_trigger.get())
</del><ins>+ && *(m_trigger.get()) == *(other.m_trigger.get())
</ins><span class="cx"> #endif
</span><del>- && m_direction == o->m_direction
- && m_fillMode == o->m_fillMode
- && m_delaySet == o->m_delaySet
- && m_directionSet == o->m_directionSet
- && m_durationSet == o->m_durationSet
- && m_fillModeSet == o->m_fillModeSet
- && m_iterationCountSet == o->m_iterationCountSet
- && m_nameSet == o->m_nameSet
- && m_propertySet == o->m_propertySet
- && m_timingFunctionSet == o->m_timingFunctionSet
</del><ins>+ && m_direction == other.m_direction
+ && m_fillMode == other.m_fillMode
+ && m_delaySet == other.m_delaySet
+ && m_directionSet == other.m_directionSet
+ && m_durationSet == other.m_durationSet
+ && m_fillModeSet == other.m_fillModeSet
+ && m_iterationCountSet == other.m_iterationCountSet
+ && m_nameSet == other.m_nameSet
+ && m_propertySet == other.m_propertySet
+ && m_timingFunctionSet == other.m_timingFunctionSet
</ins><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><del>- && m_triggerSet == o->m_triggerSet
</del><ins>+ && m_triggerSet == other.m_triggerSet
</ins><span class="cx"> #endif
</span><del>- && m_isNone == o->m_isNone;
</del><ins>+ && 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->m_playState && m_playStateSet == o->m_playStateSet);
</del><ins>+ return !matchPlayStates || (m_playState == other.m_playState && m_playStateSet == other.m_playStateSet);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const String& 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& operator=(const Animation& 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&, 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& o) const { return animationsMatch(&o); }
</del><ins>+ bool operator==(const Animation& o) const { return animationsMatch(o); }
</ins><span class="cx"> bool operator!=(const Animation& o) const { return !(*this == o); }
</span><span class="cx">
</span><span class="cx"> bool fillsBackwards() const { return m_fillModeSet && (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, &overlapTestRequests);
</span><span class="cx"> paintLayer(context, paintingInfo, paintFlags);
</span><span class="cx">
</span><del>- for (auto it : overlapTestRequests)
- it.key->setOverlapTestResult(false);
</del><ins>+ for (auto& widget : overlapTestRequests.keys())
+ widget->setOverlapTestResult(false);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderLayer::paintOverlayScrollbars(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* subtreePaintRoot)
</span><span class="lines">@@ -3820,12 +3820,12 @@
</span><span class="cx"> {
</span><span class="cx"> Vector<OverlapTestRequestClient*> overlappedRequestClients;
</span><span class="cx"> LayoutRect boundingBox = layer->boundingBox(rootLayer, layer->offsetFromAncestor(rootLayer));
</span><del>- for (auto it : overlapTestRequests) {
- if (!boundingBox.intersects(it.value))
</del><ins>+ for (auto& request : overlapTestRequests) {
+ if (!boundingBox.intersects(request.value))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- it.key->setOverlapTestResult(true);
- overlappedRequestClients.append(it.key);
</del><ins>+ request.key->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<CSSPropertyID>::const_iterator beginProperties() const { return m_properties.begin(); }
- HashSet<CSSPropertyID>::const_iterator endProperties() const { return m_properties.end(); }
</del><ins>+ const HashSet<CSSPropertyID>& 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& operator[](size_t index) const { return m_keyframes[index]; }
</span><ins>+ const Vector<KeyframeValue>& 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->m_animations.get(); }
</span><span class="cx"> const AnimationList* transitions() const { return rareNonInheritedData->m_transitions.get(); }
</span><span class="cx">
</span><ins>+ AnimationList* animations() { return rareNonInheritedData->m_animations.get(); }
+ AnimationList* transitions() { return rareNonInheritedData->m_transitions.get(); }
+
</ins><span class="cx"> AnimationList& ensureAnimations();
</span><span class="cx"> AnimationList& ensureTransitions();
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>