--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -629,18 +629,18 @@ KeyframeEffect::ConvertTarget(
result.emplace(&target.GetAsElement());
} else {
RefPtr<Element> elem = target.GetAsCSSPseudoElement().ParentElement();
result.emplace(elem, target.GetAsCSSPseudoElement().GetType());
}
return result;
}
-template <class KeyframeEffectType, class OptionsType>
-/* static */ already_AddRefed<KeyframeEffectType>
+template <class OptionsType>
+/* static */ already_AddRefed<KeyframeEffect>
KeyframeEffect::ConstructKeyframeEffect(
const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
const OptionsType& aOptions,
ErrorResult& aRv)
{
// We should get the document from `aGlobal` instead of the current Realm
@@ -663,50 +663,49 @@ KeyframeEffect::ConstructKeyframeEffect(
if (aRv.Failed()) {
return nullptr;
}
KeyframeEffectParams effectOptions =
KeyframeEffectParamsFromUnion(aOptions, aGlobal.CallerType());
Maybe<OwningAnimationTarget> target = ConvertTarget(aTarget);
- RefPtr<KeyframeEffectType> effect =
- new KeyframeEffectType(doc, target, timingParams, effectOptions);
+ RefPtr<KeyframeEffect> effect =
+ new KeyframeEffect(doc, target, timingParams, effectOptions);
effect->SetKeyframes(aGlobal.Context(), aKeyframes, aRv);
if (aRv.Failed()) {
return nullptr;
}
return effect.forget();
}
-template<class KeyframeEffectType>
-/* static */ already_AddRefed<KeyframeEffectType>
+/* static */ already_AddRefed<KeyframeEffect>
KeyframeEffect::ConstructKeyframeEffect(const GlobalObject& aGlobal,
KeyframeEffect& aSource,
ErrorResult& aRv)
{
nsIDocument* doc = AnimationUtils::GetCurrentRealmDocument(aGlobal.Context());
if (!doc) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
// Create a new KeyframeEffect object with aSource's target,
// iteration composite operation, composite operation, and spacing mode.
// The constructor creates a new AnimationEffect object by
// aSource's TimingParams.
// Note: we don't need to re-throw exceptions since the value specified on
// aSource's timing object can be assumed valid.
- RefPtr<KeyframeEffectType> effect =
- new KeyframeEffectType(doc,
- aSource.mTarget,
- aSource.SpecifiedTiming(),
- aSource.mEffectOptions);
+ RefPtr<KeyframeEffect> effect =
+ new KeyframeEffect(doc,
+ aSource.mTarget,
+ aSource.SpecifiedTiming(),
+ aSource.mEffectOptions);
// Copy cumulative change hint. mCumulativeChangeHint should be the same as
// the source one because both of targets are the same.
effect->mCumulativeChangeHint = aSource.mCumulativeChangeHint;
// Copy aSource's keyframes and animation properties.
// Note: We don't call SetKeyframes directly, which might revise the
// computed offsets and rebuild the animation properties.
effect->mKeyframes = aSource.mKeyframes;
@@ -877,38 +876,36 @@ DumpAnimationProperties(nsTArray<Animati
/* static */ already_AddRefed<KeyframeEffect>
KeyframeEffect::Constructor(
const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
const UnrestrictedDoubleOrKeyframeEffectOptions& aOptions,
ErrorResult& aRv)
{
- return ConstructKeyframeEffect<KeyframeEffect>(aGlobal, aTarget,
- aKeyframes, aOptions, aRv);
+ return ConstructKeyframeEffect(aGlobal, aTarget, aKeyframes, aOptions, aRv);
}
/* static */ already_AddRefed<KeyframeEffect>
KeyframeEffect::Constructor(const GlobalObject& aGlobal,
KeyframeEffect& aSource,
ErrorResult& aRv)
{
- return ConstructKeyframeEffect<KeyframeEffect>(aGlobal, aSource, aRv);
+ return ConstructKeyframeEffect(aGlobal, aSource, aRv);
}
/* static */ already_AddRefed<KeyframeEffect>
KeyframeEffect::Constructor(
const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
ErrorResult& aRv)
{
- return ConstructKeyframeEffect<KeyframeEffect>(aGlobal, aTarget, aKeyframes,
- aOptions, aRv);
+ return ConstructKeyframeEffect(aGlobal, aTarget, aKeyframes, aOptions, aRv);
}
void
KeyframeEffect::GetTarget(Nullable<OwningElementOrCSSPseudoElement>& aRv) const
{
if (!mTarget) {
aRv.SetNull();
return;
--- a/dom/animation/KeyframeEffect.h
+++ b/dom/animation/KeyframeEffect.h
@@ -300,26 +300,25 @@ public:
uint64_t aCurrentIterationOnLastCompose);
protected:
~KeyframeEffect() override = default;
static Maybe<OwningAnimationTarget>
ConvertTarget(const Nullable<ElementOrCSSPseudoElement>& aTarget);
- template<class KeyframeEffectType, class OptionsType>
- static already_AddRefed<KeyframeEffectType>
+ template<class OptionsType>
+ static already_AddRefed<KeyframeEffect>
ConstructKeyframeEffect(const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
const OptionsType& aOptions,
ErrorResult& aRv);
- template<class KeyframeEffectType>
- static already_AddRefed<KeyframeEffectType>
+ static already_AddRefed<KeyframeEffect>
ConstructKeyframeEffect(const GlobalObject& aGlobal,
KeyframeEffect& aSource,
ErrorResult& aRv);
// Build properties by recalculating from |mKeyframes| using |aComputedStyle|
// to resolve specified values. This function also applies paced spacing if
// needed.
nsTArray<AnimationProperty> BuildProperties(const ComputedStyle* aStyle);