From 69d7c38f3c316556094e2823d3ddde24dfb1bd57 Mon Sep 17 00:00:00 2001 From: "mstoltz%netscape.com" Date: Wed, 9 May 2001 03:23:50 +0000 Subject: [PATCH] Fix for 79595 - security manager was incorrectly blocking the assignment of event listeners. Now it correctly applies the sameOrigin check. r=jst. --- content/events/src/nsEventListenerManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp index 5270f515ec4..f3d32ed0d83 100644 --- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -62,6 +62,7 @@ #include "nsIDOMScriptObjectFactory.h" #include "nsDOMCID.h" #include "nsIScriptObjectOwner.h" // for nsIScriptEventHandlerOwner +#include "nsIClassInfo.h" static NS_DEFINE_CID(kDOMScriptObjectFactoryCID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID); @@ -973,8 +974,10 @@ nsEventListenerManager::RegisterScriptEventListener(nsIScriptContext *aContext, if (NS_FAILED(rv)) return rv; + nsCOMPtr classInfo = do_QueryInterface(aObject); + if (NS_FAILED(rv = securityManager->CheckPropertyAccess( - nsIXPCSecurityManager::ACCESS_SET_PROPERTY, cx, jsobj, aObject, nsnull, + nsIXPCSecurityManager::ACCESS_SET_PROPERTY, cx, jsobj, aObject, classInfo, "EventTarget","addEventListener", PR_FALSE))) { // XXX set pending exception on the native call context? return rv;