Bug 185837

Summary: Animated GIFs with a 90 degree X or Y rotation do not animate
Product: WebKit Reporter: Jonathan Deutsch <jonathan>
Component: ImagesAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: bfulgham, sabouhallawa, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 11   
Hardware: All   
OS: macOS 10.13   
Attachments:
Description Flags
Repro html and gif file none

Jonathan Deutsch
Reported 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.
Attachments
Repro html and gif file (279.02 KB, application/zip)
2018-05-21 13:46 PDT, Jonathan Deutsch
no flags
Jonathan Deutsch
Comment 1 2018-05-21 13:49:45 PDT
This occurs on Safari 11. This does not affect Chrome, nor Safari v6.
Radar WebKit Bug Importer
Comment 2 2018-05-23 11:10:51 PDT
Said Abou-Hallawa
Comment 3 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.
Simon Fraser (smfr)
Comment 4 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.
Note You need to log in before you can comment on or make changes to this bug.