06:20
<Clark Pan>

changing some class from JS, which triggers the animation

Yep exactly.

Tracking that would not be easy

:(

06:23
<Clark Pan>
I think it's a similar problem raised in the above ResizeObserver scenario. There's no good way to currently link these things in user land, especially if the changes came from different parts of an application.