Bug 900783: Make HasAnimationOfProperty return false in the refresh driver tick in which the transition completes. r=nrc

I don't know of any observable bug that this fixes, but the code without
this fix seems incorrect; the "removed sentinel" concept generally
requires that callers enumerating transitions check that they're not
enumerating the sentinel.

This ensures that HasAnimationOfProperty switches from returning true to
false in the first refresh cycle after the end of the animation rather
than the second.

I originally wrote this in
https://bugzilla.mozilla.org/show_bug.cgi?id=876626#c13 but it turned
out not to be related to that bug.
This commit is contained in:
L. David Baron 2013-09-09 12:21:24 +02:00
parent d44257314d
commit b71f20bcdf

View File

@ -134,7 +134,8 @@ bool
ElementTransitions::HasAnimationOfProperty(nsCSSProperty aProperty) const
{
for (uint32_t tranIdx = mPropertyTransitions.Length(); tranIdx-- != 0; ) {
if (aProperty == mPropertyTransitions[tranIdx].mProperty) {
const ElementPropertyTransition& pt = mPropertyTransitions[tranIdx];
if (aProperty == pt.mProperty && !pt.IsRemovedSentinel()) {
return true;
}
}