Bug 1260983 - Allow creating animations with a target element not bound to a document; r?heycam draft
authorBrian Birtles <birtles@gmail.com>
Fri, 01 Apr 2016 09:32:26 +0900
changeset 346448 0a49d850c4407ceebe1ffe953370af91b545275a
parent 346447 e24407917b239e31560910cb91d0e4e65bfdcfed
child 346449 35f38f2ef8fd259be7165991841c07ec663a6007
push id14377
push userbbirtles@mozilla.com
push dateFri, 01 Apr 2016 03:11:29 +0000
reviewersheycam
bugs1260983
milestone48.0a1
Bug 1260983 - Allow creating animations with a target element not bound to a document; r?heycam MozReview-Commit-ID: HHqHWikZ3zp
dom/animation/KeyframeEffect.cpp
dom/base/domerr.msg
xpcom/base/ErrorList.h
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -750,21 +750,16 @@ KeyframeEffectReadOnly::ConstructKeyfram
   CSSPseudoElementType pseudoType = CSSPseudoElementType::NotPseudo;
   if (target.IsElement()) {
     targetElement = &target.GetAsElement();
   } else {
     targetElement = target.GetAsCSSPseudoElement().ParentElement();
     pseudoType = target.GetAsCSSPseudoElement().GetType();
   }
 
-  if (!targetElement->GetComposedDoc()) {
-    aRv.Throw(NS_ERROR_DOM_ANIM_TARGET_NOT_IN_DOC_ERR);
-    return nullptr;
-  }
-
   nsTArray<Keyframe> keyframes =
     KeyframeUtils::GetKeyframesFromObject(aGlobal.Context(), aFrames, aRv);
   if (aRv.Failed()) {
     return nullptr;
   }
 
   RefPtr<KeyframeEffectType> effect =
     new KeyframeEffectType(targetElement->OwnerDoc(), targetElement,
--- a/dom/base/domerr.msg
+++ b/dom/base/domerr.msg
@@ -114,17 +114,16 @@ DOM4_MSG_DEF(BtUnhandledError,    "Unhan
 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 target is not yet supported.", NS_ERROR_DOM_ANIM_NO_TARGET_ERR)
-DOM4_MSG_DEF(NotSupportedError, "Animation with a target not bound to a document is not yet supported.", NS_ERROR_DOM_ANIM_TARGET_NOT_IN_DOC_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")
 DOM_MSG_DEF(NS_NOINTERFACE                         , "Component does not have requested interface")
--- a/xpcom/base/ErrorList.h
+++ b/xpcom/base/ErrorList.h
@@ -938,17 +938,16 @@
 #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_TARGET_ERR,                  FAILURE(2)),
-  ERROR(NS_ERROR_DOM_ANIM_TARGET_NOT_IN_DOC_ERR,          FAILURE(3)),
 #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)),