RESOLVED FIXED284625
Animated SVG referenced via img tag does not animate correctly, fine via Object tag
https://bugs.webkit.org/show_bug.cgi?id=284625
Summary Animated SVG referenced via img tag does not animate correctly, fine via Obje...
Ben Frain
Reported 2024-12-13 04:16:49 PST
This is a bug on a live site currently https://games.bet365.com/all-games/Featured (need to be logged in to see the animations). Here is a reduction of the issue: https://codepen.io/benfrain/pen/XJrNmbw An img tag links to an animated SVG file. In Safari, the animation does not render correctly, with the visuals 'breaking up'. If the same animated SVG is loaded via an Object tag, and uses different positioning in CSS, the animation displays correctly. Unsure whether the issue is simply due to the loading mechanism (img src rather than object data) or the associated CSS is a contributing factor. Note that in the reduction, toggling the `position: relative` declaration in the object related CSS rule makes the OTHER image start to display correctly, which makes no obvious sense.
Attachments
rendering in safari, firefox, chrome (2.59 MB, image/png)
2024-12-24 00:42 PST, Karl Dubost
no flags
reduced test case (908 bytes, text/html)
2025-05-30 09:34 PDT, Said Abou-Hallawa
no flags
Radar WebKit Bug Importer
Comment 1 2024-12-20 04:17:14 PST
Karl Dubost
Comment 2 2024-12-24 00:42:54 PST
Created attachment 473649 [details] rendering in safari, firefox, chrome Thanks a lot for the reduced test case. This is indeed happening. Safari Technology Preview 18.2 20621.1.6 Firefox Nightly 135.0a1 13524.12.18 Google Chrome Canary 133.0.6914.0 6914.0
Said Abou-Hallawa
Comment 3 2025-05-30 09:34:53 PDT
Created attachment 475431 [details] reduced test case I am attaching a reduced test case. I think it happens because of "object-fit: cover;" which is applied to the <img> element. If this CSS property is removed, the bug does not happen. It looks like a repainting issue.
Taher
Comment 4 2026-01-13 10:25:19 PST
EWS
Comment 5 2026-01-13 15:23:50 PST
Committed 305542@main (1b0c248d6d1d): <https://commits.webkit.org/305542@main> Reviewed commits have been landed. Closing PR #56504 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.