Bug 1080361 - Add check in setPointerCapture function. r=smaug
--- a/content/base/public/Element.h
+++ b/content/base/public/Element.h
@@ -669,16 +669,20 @@ public:
}
void SetPointerCapture(int32_t aPointerId, ErrorResult& aError)
{
bool activeState = false;
if (!nsIPresShell::GetPointerInfo(aPointerId, activeState)) {
aError.Throw(NS_ERROR_DOM_INVALID_POINTER_ERR);
return;
}
+ if (!IsInDoc()) {
+ aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+ return;
+ }
if (!activeState) {
return;
}
nsIPresShell::SetPointerCapturingContent(aPointerId, this);
}
void ReleasePointerCapture(int32_t aPointerId, ErrorResult& aError)
{
bool activeState = false;