diff --git a/dom/animation/EffectSet.cpp b/dom/animation/EffectSet.cpp index bc9ee5f62295..4180ebbfcb4f 100644 --- a/dom/animation/EffectSet.cpp +++ b/dom/animation/EffectSet.cpp @@ -42,6 +42,10 @@ EffectSet::Traverse(nsCycleCollectionTraversalCallback& aCallback) EffectSet::GetEffectSet(const dom::Element* aElement, CSSPseudoElementType aPseudoType) { + if (!aElement->MayHaveAnimations()) { + return nullptr; + } + nsIAtom* propName = GetEffectSetPropertyAtom(aPseudoType); return static_cast(aElement->GetProperty(propName)); } @@ -56,10 +60,6 @@ EffectSet::GetEffectSet(const nsIFrame* aFrame) return nullptr; } - if (!target->mElement->MayHaveAnimations()) { - return nullptr; - } - return GetEffectSet(target->mElement, target->mPseudoType); }