When an animated GIF is used as a CSS background-image, it fails to animate. This works in Safari 3.2.
This is caused by bug 19663.
Created attachment 26386 [details] Patch, testcase, changelog This was a regression from bug 19663, which changed the signature of startAnimation() in BitmapImage, but not in the base class.
Comment on attachment 26386 [details] Patch, testcase, changelog r=me
*** Bug 22647 has been marked as a duplicate of this bug. ***
Committing to http://svn.webkit.org/repository/webkit/trunk ... M LayoutTests/ChangeLog A LayoutTests/fast/backgrounds/animated-gif-as-background.html A LayoutTests/fast/backgrounds/resources/red-green-animated.gif A LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.checksum A LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.png A LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.txt M WebCore/ChangeLog M WebCore/platform/graphics/Image.h Committed r39564
This fix doesn't work for me in WebKit r39572 on Mac OS X.
Robert: what is your testcase? http://aislian.org/tile.html does fail for me sporadically (when the GIF is not cached?).
(In reply to comment #7) > Robert: what is your testcase? > > http://aislian.org/tile.html does fail for me sporadically (when the GIF is not > cached?). > I tested this reported URL. It doesn't work completely for me.
(In reply to comment #7) > http://aislian.org/tile.html does fail for me sporadically (when the GIF is not > cached?). when the gif is not cached and when you view the image before it is finished loading if I let a gif load completely in a background tab before viewing it, the gif always animates correctly (using Webkit nightly on OS X at least).
While I don't know precisely what's going on here, in general the reason for this kind of issue is that the image animation won't advance to incomplete frames and won't advances past the end of the image for non-repeating images; if a frame never gets marked complete, or the repeat count is erroneously set to "don't repeat", or draw() doesn't get called again when new data comes in from the network layer, the animation won't advance. Similar issues in the past: * In the original patch to bug 19663, the image rect was getting cleared by draw() when no animation timers were running, and thus nothing would ever automatically re-call draw() (and hence re-call startAnimation() to keep the animation moving). You can see in the final patch on that bug that there's a big comment about this in startAnimation() along with an explicit call back to startAnimation() again to keep the timer going in this case. * In bug 22108 the decoder was being destroyed mid-stream, and if it was then re-queried for the repeat count, it would return a bogus value. That patch fixed this issue by not deleting the decoder.
I'm going to call the remainder of this a dupe of bug 22995, which I've just taken, and re-close this bug, claiming it's just about the bogus method signature portion.