Bug 1450881 - Hold a reference of the target element when we get style for the element. r=birtles
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 02 May 2018 06:17:41 +0900
changeset 472593 11204de188da59d62f291caa3284749cbc8da4c8
parent 472592 288cf722769784a6da695d6c63391778b0828388
child 472594 721395128428203131d5575848cdb986009643b9
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1450881
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1450881 - Hold a reference of the target element when we get style for the element. r=birtles
dom/animation/KeyframeEffectReadOnly.cpp
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -784,16 +784,19 @@ KeyframeEffectReadOnly::GetTargetCompute
 
   MOZ_ASSERT(mTarget,
              "Should only have a document when we have a target element");
 
   nsAtom* pseudo = mTarget->mPseudoType < CSSPseudoElementType::Count
                     ? nsCSSPseudoElements::GetPseudoAtom(mTarget->mPseudoType)
                     : nullptr;
 
+  OwningAnimationTarget kungfuDeathGrip(mTarget->mElement,
+                                        mTarget->mPseudoType);
+
   return nsComputedDOMStyle::GetComputedStyle(mTarget->mElement, pseudo);
 }
 
 #ifdef DEBUG
 void
 DumpAnimationProperties(nsTArray<AnimationProperty>& aAnimationProperties)
 {
   for (auto& p : aAnimationProperties) {