Bug 1341987 - Part 4: Use nsIFrame's nsPresContext instead of getting from element. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 27 Feb 2017 11:34:48 +0900
changeset 489886 844d61344f2791f7d17ff1b08370ea53c611e57a
parent 489885 a818a00368df0cd8751700d2e9c0d6b059f9ba7e
child 547107 370ff1cf36b24dd8f5498246cdd6d76f94db6b39
push id46933
push userhikezoe@mozilla.com
push dateMon, 27 Feb 2017 02:38:59 +0000
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();