Bug 1096776 part 2 - Modify animation in order to support null timeline. r?birtles draft
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Mon, 23 May 2016 08:23:14 +0900
changeset 369364 9a016cab3ee6606d8c62e6266d86360208683e3c
parent 369363 6c48276d59f0bc1fb2c6e2b312549b41dde5f0a2
child 521553 0800157259388b1571113f9db0834b7be671251b
push id18840
push usermantaroh@gmail.com
push dateSun, 22 May 2016 23:29:40 +0000
reviewersbirtles
bugs1096776
milestone49.0a1
Bug 1096776 part 2 - Modify animation in order to support null timeline. r?birtles MozReview-Commit-ID: 5iKUtNuqKeX
dom/animation/Animation.cpp
dom/base/domerr.msg
testing/web-platform/meta/web-animations/interfaces/Animation/constructor.html.ini
testing/web-platform/meta/web-animations/interfaces/Animation/reverse.html.ini
testing/web-platform/meta/web-animations/timing-model/animations/current-time.html.ini
testing/web-platform/meta/web-animations/timing-model/animations/set-the-animation-start-time.html.ini
testing/web-platform/tests/web-animations/timing-model/animations/set-the-animation-start-time.html
xpcom/base/ErrorList.h
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -93,21 +93,16 @@ Animation::Constructor(const GlobalObjec
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
   RefPtr<Animation> animation = new Animation(global);
 
   if (!aEffect) {
     // Bug 1049975: We do not support null effect yet.
     aRv.Throw(NS_ERROR_DOM_ANIM_NO_EFFECT_ERR);
     return nullptr;
   }
-  if (!aTimeline) {
-    // Bug 1096776: We do not support null timeline yet.
-    aRv.Throw(NS_ERROR_DOM_ANIM_NO_TIMELINE_ERR);
-    return nullptr;
-  }
 
   animation->SetTimeline(aTimeline);
   animation->SetEffect(aEffect);
 
   return animation.forget();
 }
 
 void
--- a/dom/base/domerr.msg
+++ b/dom/base/domerr.msg
@@ -113,17 +113,16 @@ DOM4_MSG_DEF(BtParmInvalidError,  "Inval
 DOM4_MSG_DEF(BtUnhandledError,    "Unhandled",  NS_ERROR_DOM_BLUETOOTH_UNHANDLED)
 DOM4_MSG_DEF(BtAuthFailureError,  "Authentication failure",  NS_ERROR_DOM_BLUETOOTH_AUTH_FAILURE)
 DOM4_MSG_DEF(BtRmtDevDownError,   "Remote device down",  NS_ERROR_DOM_BLUETOOTH_RMT_DEV_DOWN)
 DOM4_MSG_DEF(BtAuthRejectedError, "Authentication rejected",  NS_ERROR_DOM_BLUETOOTH_AUTH_REJECTED)
 
 /* Web Animations errors */
 
 DOM4_MSG_DEF(NotSupportedError, "Animation to or from an underlying value is not yet supported.", NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR)
-DOM4_MSG_DEF(NotSupportedError, "Animation with no timeline is not yet supported.", NS_ERROR_DOM_ANIM_NO_TIMELINE_ERR)
 DOM4_MSG_DEF(NotSupportedError, "Animation with no effect is not yet supported.", NS_ERROR_DOM_ANIM_NO_EFFECT_ERR)
 
 /* common global codes (from nsError.h) */
 
 DOM_MSG_DEF(NS_OK                                  , "Success")
 DOM_MSG_DEF(NS_ERROR_NOT_INITIALIZED               , "Component not initialized")
 DOM_MSG_DEF(NS_ERROR_ALREADY_INITIALIZED           , "Component already initialized")
 DOM_MSG_DEF(NS_ERROR_NOT_IMPLEMENTED               , "Method not implemented")
--- a/testing/web-platform/meta/web-animations/interfaces/Animation/constructor.html.ini
+++ b/testing/web-platform/meta/web-animations/interfaces/Animation/constructor.html.ini
@@ -2,13 +2,8 @@
   type: testharness
   [Animation can be constructed with null effect and null timeline]
     expected: FAIL
     bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1049975
 
   [Animation can be constructed with null effect and non-null timeline]
     expected: FAIL
     bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1049975
-
-  [Animation can be constructed with non-null effect and null timeline]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1096776
-
deleted file mode 100644
--- a/testing/web-platform/meta/web-animations/interfaces/Animation/reverse.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[reverse.html]
-  type: testharness
-  [Reversing an animation without an active timeline throws an InvalidStateError]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1096776
deleted file mode 100644
--- a/testing/web-platform/meta/web-animations/timing-model/animations/current-time.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[current-time.html]
-  type: testharness
-  [The current time is unresolved when there is no associated timeline (and no hold time is set)]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1096776
deleted file mode 100644
--- a/testing/web-platform/meta/web-animations/timing-model/animations/set-the-animation-start-time.html.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-[set-the-animation-start-time.html]
-  type: testharness
-  [Setting the start time of an animation without an active timeline]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1096776
-
-  [Setting an unresolved start time an animation without an active timeline does not clear the current time]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1096776
-
--- a/testing/web-platform/tests/web-animations/timing-model/animations/set-the-animation-start-time.html
+++ b/testing/web-platform/tests/web-animations/timing-model/animations/set-the-animation-start-time.html
@@ -14,17 +14,17 @@ test(function(t)
 {
   // It should only be possible to set *either* the start time or the current
   // time for an animation that does not have an active timeline.
 
   var animation =
     new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC));
 
   assert_equals(animation.currentTime, null, 'Intial current time');
-  assert_equals(animation.startTuime, null, 'Intial start time');
+  assert_equals(animation.startTime, null, 'Intial start time');
 
   animation.currentTime = 1000;
   assert_equals(animation.currentTime, 1000,
                 'Setting the current time succeeds');
   assert_equals(animation.startTime, null,
                 'Start time remains null after setting current time');
 
   animation.startTime = 1000;
@@ -44,17 +44,17 @@ test(function(t)
 {
   // Setting an unresolved start time on an animation without an active
   // timeline should not clear the current time.
 
   var animation =
     new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC));
 
   assert_equals(animation.currentTime, null, 'Intial current time');
-  assert_equals(animation.startTuime, null, 'Intial start time');
+  assert_equals(animation.startTime, null, 'Intial start time');
 
   animation.currentTime = 1000;
   assert_equals(animation.currentTime, 1000,
                 'Setting the current time succeeds');
   assert_equals(animation.startTime, null,
                 'Start time remains null after setting current time');
 
   animation.startTime = null;
--- a/xpcom/base/ErrorList.h
+++ b/xpcom/base/ErrorList.h
@@ -948,18 +948,17 @@
   ERROR(NS_ERROR_SIGNED_APP_MANIFEST_INVALID,   FAILURE(1)),
 #undef MODULE
 
   /* ======================================================================= */
   /* 39: NS_ERROR_MODULE_DOM_ANIM */
   /* ======================================================================= */
 #define MODULE NS_ERROR_MODULE_DOM_ANIM
   ERROR(NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR,              FAILURE(1)),
-  ERROR(NS_ERROR_DOM_ANIM_NO_TIMELINE_ERR,                FAILURE(2)),
-  ERROR(NS_ERROR_DOM_ANIM_NO_EFFECT_ERR,                  FAILURE(3)),
+  ERROR(NS_ERROR_DOM_ANIM_NO_EFFECT_ERR,                  FAILURE(2)),
 #undef MODULE
 
   /* ======================================================================= */
   /* 40: NS_ERROR_MODULE_DOM_PUSH */
   /* ======================================================================= */
 #define MODULE NS_ERROR_MODULE_DOM_PUSH
   ERROR(NS_ERROR_DOM_PUSH_INVALID_REGISTRATION_ERR, FAILURE(1)),
   ERROR(NS_ERROR_DOM_PUSH_DENIED_ERR,               FAILURE(2)),