Bug 1275449 - Part 1: AnimationEffectTiming::SetEasing crash in page-mode addon context. r=hiro
authorDaisuke Akatsuka <daisuke@mozilla-japan.org>
Wed, 01 Jun 2016 17:40:11 +0900
changeset 340976 f6cde20f6294f7ad98fc1372dade8557a80a935c
parent 340975 3c2ac62acf836714976ba5206a4fd171df8b0d73
child 340977 f746d2a857b8f5bca06a999822c085011c30f58c
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs1275449
milestone49.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 1275449 - Part 1: AnimationEffectTiming::SetEasing crash in page-mode addon context. r=hiro MozReview-Commit-ID: DeyC4BiXJNo
dom/animation/AnimationEffectTiming.cpp
--- a/dom/animation/AnimationEffectTiming.cpp
+++ b/dom/animation/AnimationEffectTiming.cpp
@@ -129,20 +129,24 @@ AnimationEffectTiming::SetDirection(cons
   PostSpecifiedTimingUpdated(mEffect);
 }
 
 void
 AnimationEffectTiming::SetEasing(JSContext* aCx,
                                  const nsAString& aEasing,
                                  ErrorResult& aRv)
 {
+  nsIDocument* document = AnimationUtils::GetCurrentRealmDocument(aCx);
+  if (!document) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return;
+  }
+
   Maybe<ComputedTimingFunction> newFunction =
-    TimingParams::ParseEasing(aEasing,
-                              AnimationUtils::GetCurrentRealmDocument(aCx),
-                              aRv);
+    TimingParams::ParseEasing(aEasing, document, aRv);
   if (aRv.Failed()) {
     return;
   }
 
   if (mTiming.mFunction == newFunction) {
     return;
   }