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
103 B
2x2px
103 B
2x2px