MD Settings: fix collapse animation once and for all
Makes the collapsing card position: absolute (instead of fixed). Anchoring
it to the section makes it actually follow the section, so it always moves
toward the right position even if the containter's scroll/height/size changes.
Should reduce jarring jumps at the end of transitions.
Also moves the style changes into Web Animations instead of inline. This makes
the animations fire-and-forget. Transition clean up is largely automatic, there
are no styles to (forget to) remove (at the wrong time). If a transition is
buggy, we're still likely to end up in the right place.
This fixes several animation bugs (but likely introduces new ones).
BUG=
589681,
621245,
622172
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Committed:
https://crrev.com/6c4ce51ea1886af904821bdd1dd0d6d3e6932d6f
Cr-Commit-Position: refs/heads/master@{#414289}