Title: [91999] trunk/Source/WebCore
Revision
91999
Author
[email protected]
Date
2011-07-29 10:23:39 -0700 (Fri, 29 Jul 2011)

Log Message

Avoid calling animation timer updates while the page is loading
https://bugs.webkit.org/show_bug.cgi?id=64851

Patch by Zeng Huiqing <[email protected]> on 2011-07-29
Reviewed by Simon Fraser.

There is no need to update the animation timer for a RenderObject that has not yet been inserted into the render tree, or that doesn't have animations. Our tests show that this improves page loading by up to 3x on pages with a large number of transitionable objects.

* page/animation/AnimationController.cpp:
(WebCore::AnimationController::updateAnimations):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (91998 => 91999)


--- trunk/Source/WebCore/ChangeLog	2011-07-29 17:18:41 UTC (rev 91998)
+++ trunk/Source/WebCore/ChangeLog	2011-07-29 17:23:39 UTC (rev 91999)
@@ -1,3 +1,15 @@
+2011-07-29  Zeng Huiqing  <[email protected]>
+
+        Avoid calling animation timer updates while the page is loading
+        https://bugs.webkit.org/show_bug.cgi?id=64851
+
+        Reviewed by Simon Fraser.
+
+        There is no need to update the animation timer for a RenderObject that has not yet been inserted into the render tree, or that doesn't have animations. Our tests show that this improves page loading by up to 3x on pages with a large number of transitionable objects.
+
+        * page/animation/AnimationController.cpp:
+        (WebCore::AnimationController::updateAnimations):
+
 2011-07-29  Anders Carlsson  <[email protected]>
 
         Pass the HTTP referrer header for URLs loaded by plug-ins

Modified: trunk/Source/WebCore/page/animation/AnimationController.cpp (91998 => 91999)


--- trunk/Source/WebCore/page/animation/AnimationController.cpp	2011-07-29 17:18:41 UTC (rev 91998)
+++ trunk/Source/WebCore/page/animation/AnimationController.cpp	2011-07-29 17:23:39 UTC (rev 91999)
@@ -500,7 +500,8 @@
     RefPtr<CompositeAnimation> rendererAnimations = m_data->accessCompositeAnimation(renderer);
     RefPtr<RenderStyle> blendedStyle = rendererAnimations->animate(renderer, oldStyle, newStyle);
 
-    m_data->updateAnimationTimer();
+    if (renderer->parent() || newStyle->animations() || (oldStyle && oldStyle->animations()))
+        m_data->updateAnimationTimer();
 
     if (blendedStyle != newStyle) {
         // If the animations/transitions change opacity or transform, we need to update
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to