Reviewed by Hyatt.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2006 05:03:42 +0000 (05:03 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2006 05:03:42 +0000 (05:03 +0000)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=10779
        REGRESSION: Animated GIF ignores frame intervals and loops infinitely

        No test possible.

        * platform/Image.cpp:
        (WebCore::Image::shouldAnimate): Don't check that there is more than one frame,
        maybe the rest just hasn't been loaded yet.
        (WebCore::Image::startAnimation): Move the frame count check here - there is no need
        to start animating before we get at least two frames.

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

WebCore/ChangeLog
WebCore/platform/Image.cpp

index a208c38fd53e61266821d91d32a3808e5675c6ce..85663bbb089764d96c9f7018825ee989d7597b2c 100644 (file)
@@ -1,3 +1,18 @@
+2006-09-17  Alexey Proskuryakov  <ap@nypop.com>
+
+        Reviewed by Hyatt.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10779
+        REGRESSION: Animated GIF ignores frame intervals and loops infinitely
+
+        No test possible.
+
+        * platform/Image.cpp:
+        (WebCore::Image::shouldAnimate): Don't check that there is more than one frame,
+        maybe the rest just hasn't been loaded yet.
+        (WebCore::Image::startAnimation): Move the frame count check here - there is no need
+        to start animating before we get at least two frames.
+
 2006-09-17  Brady Eidson <beidson@apple.com>
 
         Reviewed by Sarge
 2006-09-17  Brady Eidson <beidson@apple.com>
 
         Reviewed by Sarge
index 56c332a0704bc6c12e9b46fd527ccb9d629daab8..928f1f058a90e22dc828d6320aef79c5d093f2ba 100644 (file)
@@ -238,12 +238,12 @@ bool Image::frameHasAlphaAtIndex(size_t index)
 
 bool Image::shouldAnimate()
 {
 
 bool Image::shouldAnimate()
 {
-    return (m_animatingImageType && frameCount() > 1 && !m_animationFinished && m_animationObserver);
+    return (m_animatingImageType && !m_animationFinished && m_animationObserver);
 }
 
 void Image::startAnimation()
 {
 }
 
 void Image::startAnimation()
 {
-    if (m_frameTimer || !shouldAnimate())
+    if (m_frameTimer || !shouldAnimate() || frameCount() <= 1)
         return;
 
     m_frameTimer = new Timer<Image>(this, &Image::advanceAnimation);
         return;
 
     m_frameTimer = new Timer<Image>(this, &Image::advanceAnimation);