Re: [csswg-drafts] [css-images] Disabling image animation (#1615)

We've been looking into the idea of pausing/resuming animated images (gifs, apngs).

From the browsers implementation perspective, a duplicated animated image in a page uses the same internal data structures and as mentioned before are played synchronously. Pausing all the instance of the same animated image at once seems doable, but if we want to stop a single instance independently on the others we'll have to use extra memory to keep separated data for both images. Not really sure if web engines would be happy to do something like that, so we've just added [a use counter in Chromium](https://chromestatus.com/metrics/feature/timeline/popularity/5605) to try to identify how often animated images are used more than once in the same document (the patch has recently landed so there's no data yet in the chart, but we'll start getting some data in a few weeks). We hope this information about how often websites are using duplicated animated images can help us to define the requirements here, if it's not a common use case maybe it's not worth the effort of having independent instances.

However while working on the use counter we have realized that there are multiple cases of animated images, and not sure if we should consider them all or not:
* `<img>` tag
* CSS properties `background-image: url(...);`
* Generated content `:: after { content: url(...); }`
* `<video>` poster attribute
* `<embed>` tag
* `<object>` tag
* SVG `<image>`

And I can still be missing a few in this list.

The current use counter identifies duplicated images in the following cases: `<img>`, `<embed>` and `<object>` tags, generated content, and `<video>` poster. But it doesn't count images from CSS properties or SVG `<image>`. We can tweak the use counter to cover more cases, but not sure which ones would be really relevant here.


-- 
GitHub Notification of comment by mrego
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1615#issuecomment-3051522686 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 9 July 2025 07:38:27 UTC