Bug 35065

Summary: Delay between page loading and animated GIF playing
Product: WebKit Reporter: Mark Rowe (bdash) <mrowe>
Component: ImagesAssignee: Peter Kasting <pkasting>
Status: RESOLVED FIXED    
Severity: Normal CC: mrowe, pkasting
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.6   
URL: http://i.imgur.com/Zgc5p.gif
Bug Depends on: 35115    
Bug Blocks:    
Attachments:
Description Flags
Patch v1 none

Description Mark Rowe (bdash) 2010-02-17 17:56:50 PST
When doing an uncached load of <http://i.imgur.com/Zgc5p.gif> there is a delay of around 5 seconds after the image finishes loading before the animation starts running.

<rdar://problem/7109548>
Comment 1 Mark Rowe (bdash) 2010-02-17 18:06:05 PST
Created attachment 48955 [details]
Patch v1

This appears to address the issue.
Comment 2 Mark Rowe (bdash) 2010-02-17 18:08:00 PST
CCing Mr Peter Kasting as he did a lot of work on this code back in the day.
Comment 3 Mark Rowe (bdash) 2010-02-17 18:19:52 PST
Fixed in r54919.
Comment 4 Peter Kasting 2010-02-17 19:19:48 PST
The old code was definitely way wrong.  Thanks for fixing!

The new patch has a small bug: the first time through, when the desired frame start time is zero, we should set the desired start time immediately.  Otherwise the GIF start lags by the amount of time needed to decode the second frame.  This is minor, but can make a difference on sites like YTMND.  I'll write a patch for this.
Comment 5 Peter Kasting 2010-02-17 19:20:13 PST
Comment on attachment 48955 [details]
Patch v1

Clearing flags on this patch, as it has landed.
Comment 6 Mark Rowe (bdash) 2010-02-17 21:07:39 PST
(In reply to comment #4)
> The old code was definitely way wrong.  Thanks for fixing!
> 
> The new patch has a small bug: the first time through, when the desired frame
> start time is zero, we should set the desired start time immediately. 
> Otherwise the GIF start lags by the amount of time needed to decode the second
> frame.  This is minor, but can make a difference on sites like YTMND.  I'll
> write a patch for this.

Please file a new bug.  That’s clearly a different issue than what this bug was about, so repurposing it for that doesn’t seem sensible.