Bug 1380258 - Check corresponding frame in case of pseudo element instead of parent frame. r?birtles
In case of pseudo element, AnimationsWithDestroyedFrame holds the parent
element instead of generated pseudo content, so the primary frame of the
holding content is not the primary frame for pseudo elements. We need to
check correct primary frame respectively.
MozReview-Commit-ID: DleEoV13G1f
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1809,18 +1809,28 @@ RestyleManager::AnimationsWithDestroyedF
nsTArray<RefPtr<nsIContent>>& aArray,
CSSPseudoElementType aPseudoType)
{
nsAnimationManager* animationManager =
mRestyleManager->PresContext()->AnimationManager();
nsTransitionManager* transitionManager =
mRestyleManager->PresContext()->TransitionManager();
for (nsIContent* content : aArray) {
- if (content->GetPrimaryFrame()) {
- continue;
+ if (aPseudoType == CSSPseudoElementType::NotPseudo) {
+ if (content->GetPrimaryFrame()) {
+ continue;
+ }
+ } else if (aPseudoType == CSSPseudoElementType::before) {
+ if (nsLayoutUtils::GetBeforeFrame(content)) {
+ continue;
+ }
+ } else if (aPseudoType == CSSPseudoElementType::after) {
+ if (nsLayoutUtils::GetAfterFrame(content)) {
+ continue;
+ }
}
dom::Element* element = content->AsElement();
animationManager->StopAnimationsForElement(element, aPseudoType);
transitionManager->StopAnimationsForElement(element, aPseudoType);
// All other animations should keep running but not running on the
// *compositor* at this point.