Bug 1353987 - Clear ready promise when animation is canceled. r=birtles
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Mon, 12 Jun 2017 10:45:48 +0900
changeset 413906 8047b74cb02259717a3e0714b75a4a181e1b15c0
parent 413905 fab1fc13a6496b0b20cd6a5b4ccebe9e8bfebfc9
child 413907 401127e8ba3bf0890d843c33173f9d1fb182e643
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1353987
milestone55.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 1353987 - Clear ready promise when animation is canceled. r=birtles According to the spec, when we cancel an animation we should "reset an animation's pending tasks"[1] which has following step: ... 4. Reject animation’s current ready promise with a DOMException named "AbortError". 5. Let animation’s current ready promise be the result of creating a new resolved Promise object. Since we create the ready promise and, if need resolve it when we create it (see Animation::GetReady), this patch simply clear the ready promise when an animation is canceled. [1] https://w3c.github.io/web-animations/#reset-an-animations-pending-tasks MozReview-Commit-ID: JxoqeA5dXCO
dom/animation/Animation.cpp
testing/web-platform/meta/MANIFEST.json
testing/web-platform/meta/web-animations/timing-model/animations/canceling-an-animation.html.ini
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -1361,16 +1361,17 @@ Animation::ResetPendingTasks()
 {
   if (mPendingState == PendingState::NotPending) {
     return;
   }
 
   CancelPendingTasks();
   if (mReady) {
     mReady->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
+    mReady = nullptr;
   }
 }
 
 bool
 Animation::IsPossiblyOrphanedPendingAnimation() const
 {
   // Check if we are pending but might never start because we are not being
   // tracked.
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -220234,17 +220234,17 @@
    "5ef1183a4d3e12ad3edfe678c9fa002e7edce888",
    "support"
   ],
   "web-animations/resources/keyframe-utils.js": [
    "ff5700466b5af6ffaad824437d6566003a22e25b",
    "support"
   ],
   "web-animations/testcommon.js": [
-   "b12f7087f2adec5ce2a2b8e07be2f24d68aa9df2",
+   "d057ad66c4561ef32f83770e4948f2019da89d48",
    "support"
   ],
   "web-animations/timing-model/animation-effects/active-time.html": [
    "42eb1a23e89ae60ccd0a3664a9a583df1eb30d49",
    "testharness"
   ],
   "web-animations/timing-model/animation-effects/current-iteration.html": [
    "b08a35ae832ce33da7fe7fee22e589a6b85a6353",
deleted file mode 100644
--- a/testing/web-platform/meta/web-animations/timing-model/animations/canceling-an-animation.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[canceling-an-animation.html]
-  type: testharness
-  [The ready promise should be replaced when the animation is canceled]
-    expected: FAIL
-