2009-02-05 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Feb 2009 05:09:41 +0000 (05:09 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Feb 2009 05:09:41 +0000 (05:09 +0000)
        Reviewed by Anders Carlsson

        getAnimatedStyleForRenderer() should not create a new
        CompositeAnimation if the object isn't already animating, and
        it should just fall back to returning renderer->style().

        * page/animation/AnimationController.cpp:
        (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@40706 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/animation/AnimationController.cpp

index 3b2d257..a17c793 100644 (file)
@@ -1,5 +1,16 @@
 2009-02-05  Simon Fraser  <simon.fraser@apple.com>
 
+        Reviewed by Anders Carlsson
+
+        getAnimatedStyleForRenderer() should not create a new
+        CompositeAnimation if the object isn't already animating, and
+        it should just fall back to returning renderer->style().
+        
+        * page/animation/AnimationController.cpp:
+        (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):
+
+2009-02-05  Simon Fraser  <simon.fraser@apple.com>
+
         Fix build when ACCELERATED_COMPOSITING is turned on.
        
         Give RenderLayerBacking some love after the great
index e58cf84..6a87bf7 100644 (file)
@@ -270,11 +270,16 @@ double AnimationControllerPrivate::beginAnimationUpdateTime()
 
 PassRefPtr<RenderStyle> AnimationControllerPrivate::getAnimatedStyleForRenderer(RenderObject* renderer)
 {
+    if (!renderer)
+        return 0;
+
+    RefPtr<CompositeAnimation> rendererAnimations = m_compositeAnimations.get(renderer);
+    if (!rendererAnimations)
+        return renderer->style();
+    
     // Make sure animationUpdateTime is updated, so that it is current even if no
-    // styleChange has happened (e.g. accelerated animations)
+    // styleChange has happened (e.g. accelerated animations).
     setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet);
-
-    RefPtr<CompositeAnimation> rendererAnimations = accessCompositeAnimation(renderer);
     return rendererAnimations->getAnimatedStyle();
 }