Bug 47302

Summary: Treat GIFs with no loop count as "loop once"
Product: WebKit Reporter: Peter Kasting <pkasting>
Component: ImagesAssignee: Peter Kasting <pkasting>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
patch v1
jamesr: review-
patch with test none

Peter Kasting
Reported 2010-10-06 14:04:32 PDT
While decoding GIFs with no loop count, we treat them as "loop once". But, due to an oversight, when we reach the end and still haven't seen the loop count, we think the loop count is the internally-used value "-2" ("not seen"), which the animation code in BitmapImage.cpp interprets as "don't animate". This means that, after the GIF animates, if script then changes another <img>'s "src" to point at it, it will display the first frame and stop instead of looping once.
Attachments
patch v1 (3.46 KB, patch)
2010-10-06 14:09 PDT, Peter Kasting
jamesr: review-
patch with test (12.39 KB, patch)
2010-10-29 12:06 PDT, Peter Kasting
no flags
Peter Kasting
Comment 1 2010-10-06 14:09:17 PDT
Created attachment 69987 [details] patch v1 Simple fix. I haven't had time to create a good layout test. Testing this will be a little tricky; I'll need to create a custom 2-frame GIF with no loop count and write a pixel test based on based on the "index.html" reduction in http://crbug.com/56077 .
James Robinson
Comment 2 2010-10-06 16:40:50 PDT
Comment on attachment 69987 [details] patch v1 This really should have a test. I don't think the bug fix is so critical that it should land untested.
Peter Kasting
Comment 3 2010-10-29 12:06:40 PDT
Created attachment 72361 [details] patch with test Same as the above patch, but this time with a test.
Adam Barth
Comment 4 2010-10-31 18:04:33 PDT
Comment on attachment 72361 [details] patch with test Yay tests.
WebKit Commit Bot
Comment 5 2010-10-31 19:04:42 PDT
Comment on attachment 72361 [details] patch with test Clearing flags on attachment: 72361 Committed r71001: <http://trac.webkit.org/changeset/71001>
WebKit Commit Bot
Comment 6 2010-10-31 19:04:46 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.