Yeah, one could do that. But while there are good use cases for MutationObservers and they are supposedly much faster than DOM mutation events, they, and the logic they fire, are still performance burdens.
I think in this case, CSS is all you need. And the above CSS itself looks fine to me. If applied to a document, it should prevent all CSS animations/transitions. But:
- It is currently not properly applied to all document.
- Animated GIFs, videos and the like will also still play.