Bug 1260983 - Allow creating animations with a target element not bound to a document; r?heycam
MozReview-Commit-ID: HHqHWikZ3zp
--- 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)),