StyleComputer is responsible for assigning animation targets, so we
have to make sure there are no pending style updates before querying
animations of an element.
This change also introduces a version of getAnimations() that does not
check style updates and used by StyleComputer to avoid mutual recursion.
(cherry picked from commit 94b3b84dd808b6607e8fd0aead1796709f3a8721)
Fixes the bug when animation does not run at all if an element has a
pseudo-element, because both of them use the same cache.
(cherry picked from commit 4049cce40cce31c45e528bbdf301b4e63b8912db)
This is closer to what the spec instructs us to do, and matches how
associations are maintained in the timelines. Also note that the removed
destructor logic is not necessary since we visit the associated
animations anyways.