Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix($animate): clear the GCS cache even when no animation is detected #9382

Closed
wants to merge 1 commit into from

Conversation

matsko
Copy link
Contributor

@matsko matsko commented Oct 2, 2014

$animate aims to speed up redundant calls to getComputedStyle to prevent
unessarry reflows in the event that similar elements are being animated
at the same time. A hidden bug was causing the GCS cache not to be reset
if an CSS-based animation was not found. This patch ensures that the
GCS lookup cache is always cleared after one animation reflow has
passed.

Closes #8813

@matsko
Copy link
Contributor Author

matsko commented Oct 2, 2014

@IgorMinar
Copy link
Contributor

sorry, I reviewed this yesterday but forgot to comment.

the test looks good to me, but to be honest the source change looks right, but I can't tell for sure if it doesn't have other side effects.

can you improve the comments you left on github and move them to the actual code?

otherwise lgtm I guess ;-)

$animate will cache subsequent calls to GCS in the event that the element
with the same CSS classes and the same parentNode is being animated. Once the
animation is started then $animate waits for one rAF before flushing the GCS
lookup cache. Prior to this fix, if GCS was unable to detect any transitions
or keyframes on the element then it would simply close the animation, but it
would not trigger the rAF code to flush the cache. This issue caused a bug
which made it difficult to detect why certain animations are not allowed to
fire if the element didn't contain any CSS-based animations beforehand.

Closes angular#8813
@IgorMinar
Copy link
Contributor

lgtm

@matsko
Copy link
Contributor Author

matsko commented Oct 7, 2014

MERGED as cb85cbc and f619d03

@matsko matsko closed this Oct 7, 2014
@btford btford removed the In Progress label Oct 7, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ngAnimate cache prevents transitions on added classes in FF
5 participants