diff --git a/content/base/public/Element.h b/content/base/public/Element.h index 891f0f5617d..a9fa985a191 100644 --- a/content/base/public/Element.h +++ b/content/base/public/Element.h @@ -674,6 +674,10 @@ public: aError.Throw(NS_ERROR_DOM_INVALID_POINTER_ERR); return; } + if (!IsInDoc()) { + aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return; + } if (!activeState) { return; }