Files
sousa-gecko/testing/web-platform/tests/webcodecs/animated-zero-delay.gif
T
Xidorn QuanandClaude Opus 4.6 06e6579ee6 Bug 2036986 - Fix ImageDecoder failing to decode animated GIFs with zero first-frame delay. r=aosmond
Some animated GIFs have a first-frame delay of zero (or no Graphic Control Extension for the first frame). The metadata decoder terminates after parsing the first frame's image descriptor without ever encountering a second frame, so it reports the image as non-animated. Previously, `AnonymousDecoderImpl` would trust this result, set `frameCount=1`/`frameCountComplete=true`, and destroy the frame count task. This caused `ImageDecoder` to return zero for frame count making code running it consider the GIF to be non-animated, differing from the rendering result when such a GIF presents in DOM.

The fix always runs the frame count task after metadata completes, even when the metadata decoder reported non-animated. The frame count task does a full parse (with `COUNT_FRAMES` flag) and will discover additional frames. If it finds more than one frame, we update the animated flag before resolving the metadata promise to `ImageDecoder`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Differential Revision: https://phabricator.services.mozilla.com/D298735
2026-05-20 18:17:46 +00:00

103 B
2x2px