I was chatting with Andy Clarke the other day about a new article he wants to write about SVG animations.
“I’ve read some things that said that SMIL might be a dead end.” He said. “Whaddya think?”
That was my impression, too. Sarah Drasner summed up the situation nicely way back in 2017:
Unfortunately, support for SMIL is waning in WebKit, and has never (nor will likely ever) exist for Microsoft’s IE or Edge browsers.
Chrome was also in on the party and published an intent to deprecate SMIL, citing work in other browsers to support SVG animations in CSS. MDN linked to that same thread in its SMIL documentation when it published a deprecation warning.
Well, Chrome never deprecated SMIL. At least according to this reply in the thread dated 2023. And since then, we’ve also seen Microsoft’s Edge adopt a Chromium engine, effectively making it a Chrome clone. Also, last I checked, Caniuse reports full support in WebKit browsers.
This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up.
Desktop
| Chrome | Firefox | IE | Edge | Safari |
|---|---|---|---|---|
| 5 | 4 | 11 | 79 | 6 |
Mobile / Tablet
| Android Chrome | Android Firefox | Android | iOS Safari |
|---|---|---|---|
| 145 | 147 | 3 | 6.0-6.1 |
Now, I’m not saying that SMIL is perfectly alive and well. It could still very well be in the doldrums, especially when there are robust alternatives in CSS and JavaScript. But it’s also not dead in the water.
Waiting for the Chrome Engineer to explain what happened!
I can share a perspective from WebKit — while SMIL is definitely implemented and functional (back then a requirement to pass Acid 3), it doesn’t share the same code paths as CSS Animations/Transitions to realize animations. In WebKit, that means transform -related animations, such as SMIL won’t be hardware accelerated, unlike the CSS Animation counterpart, when animating the CSS ‘transform’ property. Therefore, while it is functional, don’t expect performance wonders when applying SMIL animations.
Furthermore SMIL, nowadays (unlike in the early 2000s), is only relevant for SVG, cannot be applied to HTML. On the other hand, the general CSS concepts such as CSS Animations/Transitions, target HTML/SVG/etc. with one unified concept. Before we had CSS Animations, there was no declarative way to handle animations — it was all scripted. Since the advent of CSS Animations, the importance of SMIL gradually vanished. NOTE: This is my personal opinion, not WebKit or Apple position.
From my personal experience (not from any benchmark or anything) the things that make websites the laggiest are over the top animations. Knowing SMIL isn’t hardware accelerated puts the final nail on the coffin. So please, let’s deprecate it.
Before it’s deprecated, the W3C engineers would have to consider the number of tools and websites that may have integrated SMIL into their core system (not that the number would be a lot anyway). If it’s a good number, just like some functions in CSS that have no meaning when previous functions now support what they do (rgb() doing what rgba() is doing), I suggest it’s best we leave it as it is rather than marking it for removal.
If not, the deprecation way we go!
The one advantage SMIL has over CSS is the ability to sequence animations. Of course libraries like gsap are far support superior for that sort of thing, but it’s nice to have SMIL in your tool bag when you don’t have an option of using an external library.
So it truly isn’t dead in the water, but actually growing in use.
SMIL usage has grown to nearly 2.5% of page loads as of the time of this writing and is steadily increasing in use as time goes by – https://chromestatus.com/metrics/feature/timeline/popularity/501
While I do think the alternatives Sarah listed are technically better, deprecating SMIL at this time when it’s still being used may not be the best move.
Great discussion on SMIL! And though its relevance is lesser than it was in the days of CSS animations and JavaScript libraries like GSAP, it is curious to note that SMIL has a niche use case, especially for sequencing animations without needing external dependencies. The fact that it’s not completely gone is some solace, especially since browser support is still available. But due to its performance limitations, hardware acceleration and other issues, it may be better for developers to move towards modern alternatives where feasible. Hope to see more insights
What is the meaning of this?