Bug 1341987 - Part 4: Use nsIFrame's nsPresContext instead of getting from element. r=birtles
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 27 Feb 2017 11:34:48 +0900
changeset 374023 64b46c83b0cd3e2878f491b4a3de9a7db85a7fca
parent 374022 81cfa489cb872e065067eefcad1a60487bb7d5a3
child 374024 cbf582404538b9aef87beef0fa4cbed4928388ff
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1341987
milestone54.0a1
Bug 1341987 - Part 4: Use nsIFrame's nsPresContext instead of getting from element. r=birtles MozReview-Commit-ID: 3pWt7d2MKsZ
dom/animation/KeyframeEffectReadOnly.cpp
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -1355,23 +1355,17 @@ KeyframeEffectReadOnly::CanThrottleTrans
   // If we know that the animation cannot cause overflow,
   // we can just disable flushes for this animation.
 
   // If we don't show scrollbars, we don't care about overflow.
   if (LookAndFeel::GetInt(LookAndFeel::eIntID_ShowHideScrollbars) == 0) {
     return true;
   }
 
-  nsPresContext* presContext = GetPresContext();
-  // CanThrottleTransformChanges is only called as part of a refresh driver tick
-  // in which case we expect to has a pres context.
-  MOZ_ASSERT(presContext);
-
-  TimeStamp now =
-    presContext->RefreshDriver()->MostRecentRefresh();
+  TimeStamp now = aFrame.PresContext()->RefreshDriver()->MostRecentRefresh();
 
   EffectSet* effectSet = EffectSet::GetEffectSet(mTarget->mElement,
                                                  mTarget->mPseudoType);
   MOZ_ASSERT(effectSet, "CanThrottleTransformChanges is expected to be called"
                         " on an effect in an effect set");
   MOZ_ASSERT(mAnimation, "CanThrottleTransformChanges is expected to be called"
                          " on an effect with a parent animation");
   TimeStamp lastSyncTime = effectSet->LastTransformSyncTime();