mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 1171817 part 16 - Always cancel transitions before removing them; r=dbaron
Earlier in this patch series we added an assertion to the destructor for CSSAnimation and CSSTransition to check that the owning element has been cleared when the animation is destroyed. This assertion fails, however, for transitions because there are a two code paths where a transition may be destroyed without being cancelled. This patch adjusts those two code paths to ensure transitions are always cancelled before being destroyed. --HG-- extra : commitid : 6kwqrE1A55J extra : rebase_source : 86df7ec85ede5d2015e0239efd90b531e16b8aa1
This commit is contained in:
parent
5fd77720f9
commit
cf56e70bfb
@ -406,9 +406,9 @@ nsTransitionManager::StyleContextChanged(dom::Element *aElement,
|
|||||||
currentValue != segment.mToValue) {
|
currentValue != segment.mToValue) {
|
||||||
// stop the transition
|
// stop the transition
|
||||||
if (!anim->GetEffect()->IsFinishedTransition()) {
|
if (!anim->GetEffect()->IsFinishedTransition()) {
|
||||||
anim->CancelFromStyle();
|
|
||||||
collection->UpdateAnimationGeneration(mPresContext);
|
collection->UpdateAnimationGeneration(mPresContext);
|
||||||
}
|
}
|
||||||
|
anim->CancelFromStyle();
|
||||||
animations.RemoveElementAt(i);
|
animations.RemoveElementAt(i);
|
||||||
}
|
}
|
||||||
} while (i != 0);
|
} while (i != 0);
|
||||||
@ -721,6 +721,7 @@ nsTransitionManager::PruneCompletedTransitions(mozilla::dom::Element* aElement,
|
|||||||
if (!ExtractComputedValueForTransition(prop.mProperty, aNewStyleContext,
|
if (!ExtractComputedValueForTransition(prop.mProperty, aNewStyleContext,
|
||||||
currentValue) ||
|
currentValue) ||
|
||||||
currentValue != segment.mToValue) {
|
currentValue != segment.mToValue) {
|
||||||
|
anim->CancelFromStyle();
|
||||||
animations.RemoveElementAt(i);
|
animations.RemoveElementAt(i);
|
||||||
}
|
}
|
||||||
} while (i != 0);
|
} while (i != 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user