diff --git a/layout/style/nsAnimationManager.cpp b/layout/style/nsAnimationManager.cpp index f0ba33f15b57..e8e31fa24dcf 100644 --- a/layout/style/nsAnimationManager.cpp +++ b/layout/style/nsAnimationManager.cpp @@ -473,13 +473,14 @@ private: static Maybe ConvertTimingFunction(const nsTimingFunction& aTimingFunction); +template static void UpdateOldAnimationPropertiesWithNew( CSSAnimation& aOld, TimingParams& aNewTiming, nsTArray&& aNewKeyframes, bool aNewIsStylePaused, - CSSAnimationBuilder& aBuilder) + BuilderType& aBuilder) { bool animationChanged = false; @@ -526,11 +527,12 @@ UpdateOldAnimationPropertiesWithNew( // Returns a new animation set up with given StyleAnimation. // Or returns an existing animation matching StyleAnimation's name updated // with the new StyleAnimation. +template static already_AddRefed BuildAnimation(nsPresContext* aPresContext, const NonOwningAnimationTarget& aTarget, const StyleAnimation& aSrc, - CSSAnimationBuilder& aBuilder, + BuilderType& aBuilder, nsAnimationManager::CSSAnimationCollection* aCollection) { MOZ_ASSERT(aPresContext); @@ -1030,12 +1032,13 @@ CSSAnimationBuilder::GetComputedValue(nsPresContext* aPresContext, return result; } +template static nsAnimationManager::OwningCSSAnimationPtrArray BuildAnimations(nsPresContext* aPresContext, const NonOwningAnimationTarget& aTarget, const nsStyleAutoArray& aStyleAnimations, uint32_t aStyleAnimationNameCount, - CSSAnimationBuilder& aBuilder, + BuilderType& aBuilder, nsAnimationManager::CSSAnimationCollection* aCollection) { nsAnimationManager::OwningCSSAnimationPtrArray result; @@ -1089,11 +1092,12 @@ nsAnimationManager::UpdateAnimations(nsStyleContext* aStyleContext, DoUpdateAnimations(target, *disp, builder); } +template void nsAnimationManager::DoUpdateAnimations( const NonOwningAnimationTarget& aTarget, const nsStyleDisplay& aStyleDisplay, - CSSAnimationBuilder& aBuilder) + BuilderType& aBuilder) { // Everything that causes our animation data to change triggers a // style change, which in turn triggers a non-animation restyle. diff --git a/layout/style/nsAnimationManager.h b/layout/style/nsAnimationManager.h index f67e1d129562..3c2ab74b3255 100644 --- a/layout/style/nsAnimationManager.h +++ b/layout/style/nsAnimationManager.h @@ -15,7 +15,6 @@ class nsIGlobalObject; class nsStyleContext; -class CSSAnimationBuilder; // tentative, will be removed struct nsStyleDisplay; namespace mozilla { @@ -357,10 +356,11 @@ protected: ~nsAnimationManager() override = default; private: + template void DoUpdateAnimations( const mozilla::NonOwningAnimationTarget& aTarget, const nsStyleDisplay& aStyleDisplay, - CSSAnimationBuilder& aBuilder); + BuilderType& aBuilder); mozilla::DelayedEventDispatcher mEventDispatcher; };