diff --git a/dom/animation/Animation.cpp b/dom/animation/Animation.cpp index 1014fa16982..e424764c212 100644 --- a/dom/animation/Animation.cpp +++ b/dom/animation/Animation.cpp @@ -444,7 +444,7 @@ Animation::DoCancel() mHoldTime.SetNull(); mStartTime.SetNull(); - UpdateEffect(); + UpdateTiming(SeekFlag::NoSeek); } void diff --git a/layout/style/nsAnimationManager.cpp b/layout/style/nsAnimationManager.cpp index 6356a772157..1c952179c95 100644 --- a/layout/style/nsAnimationManager.cpp +++ b/layout/style/nsAnimationManager.cpp @@ -420,6 +420,8 @@ nsAnimationManager::CheckAnimationRule(nsStyleContext* aStyleContext, } } + oldAnim->CopyAnimationIndex(*newAnim->AsCSSAnimation()); + if (animationChanged) { nsNodeUtils::AnimationChanged(oldAnim); } @@ -553,6 +555,7 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext, nsRefPtr dest = new CSSAnimation(aTimeline, src.GetName()); dest->SetOwningElement(*aTarget, aStyleContext->GetPseudoType()); + dest->SetAnimationIndex(static_cast(animIdx)); aAnimations.AppendElement(dest); AnimationTiming timing; diff --git a/layout/style/nsAnimationManager.h b/layout/style/nsAnimationManager.h index ae2237a5074..9196a858f0c 100644 --- a/layout/style/nsAnimationManager.h +++ b/layout/style/nsAnimationManager.h @@ -101,10 +101,25 @@ public: mOwningPseudoType = nsCSSPseudoElements::ePseudo_NotPseudoElement; Animation::CancelFromStyle(); + MOZ_ASSERT(mSequenceNum == kUnsequenced); } bool IsStylePaused() const { return mIsStylePaused; } + bool IsUsingCustomCompositeOrder() const override { return !!mOwningElement; } + + void SetAnimationIndex(uint64_t aIndex) + { + MOZ_ASSERT(IsUsingCustomCompositeOrder()); + mSequenceNum = aIndex; + } + void CopyAnimationIndex(const CSSAnimation& aOther) + { + MOZ_ASSERT(IsUsingCustomCompositeOrder() && + aOther.IsUsingCustomCompositeOrder()); + mSequenceNum = aOther.mSequenceNum; + } + void QueueEvents(EventArray& aEventsToDispatch); // Returns the element or pseudo-element whose animation-name property