Bug 185837 - Animated GIFs with a 90 degree X or Y rotation do not animate
Summary: Animated GIFs with a 90 degree X or Y rotation do not animate
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: Safari 11
Hardware: All macOS 10.13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-21 13:46 PDT by Jonathan Deutsch
Modified: 2018-05-23 11:45 PDT (History)
5 users (show)

See Also:


Attachments
Repro html and gif file (279.02 KB, application/zip)
2018-05-21 13:46 PDT, Jonathan Deutsch
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Deutsch 2018-05-21 13:46:18 PDT
Created attachment 340881 [details]
Repro html and gif file

If an animated GIF (either via background-image or img tag) is set to have a 90 degree rotation on the X or Y axis (3d) then it will not animate.

If there is no perspective this may make sense as a performance optimization, but it occurs even if perspective is set and the image is being shown.

Attachment has a simple repro case.

Resizing the window causes a single frame re-render.
Comment 1 Jonathan Deutsch 2018-05-21 13:49:45 PDT
This occurs on Safari 11.
This does not affect Chrome, nor Safari v6.
Comment 2 Radar WebKit Bug Importer 2018-05-23 11:10:51 PDT
<rdar://problem/40491727>
Comment 3 Said Abou-Hallawa 2018-05-23 11:15:39 PDT
This happens because when the <img> element is drawn with perspective css, it is drawn to a layer by getting the current frame and setting its to the layer through GraphicsLayerCA::setContentsToImage().

Getting the current frame by calling BitmapImage::frameImageAtIndexCacheIfNeeded() forces sync image decoding and does start the animation timer for the next frame.
Comment 4 Simon Fraser (smfr) 2018-05-23 11:45:02 PDT
So the "set layer contents to image" code path does the wrong thing with rotated frames? We should turn off the optimization in that case.