Bug 1358570: Make PurgeCompletedTransitions lookup the correct animation collection. r?hiro
Probably GetAnimationCollection itself should assert against it, but that's a
bigger task right now...
MozReview-Commit-ID: JxFWXtgMAXy
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -1896,18 +1896,18 @@ nsCSSFrameConstructor::CreateGeneratedCo
nsStyleContext* oldStyleContext = rsc->Get(container, aPseudoElement);
if (oldStyleContext) {
GeckoRestyleManager::TryInitiatingTransition(aState.mPresContext,
container,
oldStyleContext,
&pseudoStyleContext);
} else {
aState.mPresContext->TransitionManager()->
- PruneCompletedTransitions(container, aPseudoElement,
- pseudoStyleContext);
+ PruneCompletedTransitions(aParentContent->AsElement(),
+ aPseudoElement, pseudoStyleContext);
}
}
}
uint32_t contentCount = pseudoStyleContext->StyleContent()->ContentCount();
for (uint32_t contentIndex = 0; contentIndex < contentCount; contentIndex++) {
nsCOMPtr<nsIContent> content =
CreateGeneratedContent(aState, aParentContent, pseudoStyleContext,
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -1104,16 +1104,19 @@ nsTransitionManager::ConsiderInitiatingT
aWhichStarted->AddProperty(aProperty);
}
void
nsTransitionManager::PruneCompletedTransitions(mozilla::dom::Element* aElement,
CSSPseudoElementType aPseudoType,
nsStyleContext* aNewStyleContext)
{
+ MOZ_ASSERT(!aElement->IsGeneratedContentContainerForBefore() &&
+ !aElement->IsGeneratedContentContainerForAfter());
+
CSSTransitionCollection* collection =
CSSTransitionCollection::GetAnimationCollection(aElement, aPseudoType);
if (!collection) {
return;
}
// Remove any finished transitions whose style doesn't match the new
// style.