From 6eda51fef3dca142f2a8e3942733d8b4e960447a Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Sun, 18 Jul 2004 20:02:31 +0000 Subject: [PATCH] nsIContentPolicy should pass the frameelement for loads in frames as aRequestingNode. Bug 245836, r=mvl, sr=jst --- docshell/base/nsDocShell.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 9231db46a9a..e268718196a 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -5110,16 +5110,15 @@ nsDocShell::InternalLoad(nsIURI * aURI, // Only abort the load if a content policy listener explicitly vetos it! // nsCOMPtr requestingElement; + // Use nsPIDOMWindow since we _want_ to cross the chrome boundary if needed + nsCOMPtr privateWin(do_QueryInterface(mScriptGlobal)); + if (privateWin) + requestingElement = privateWin->GetFrameElementInternal(); PRInt16 shouldLoad = nsIContentPolicy::ACCEPT; PRUint32 contentType; if (IsFrame()) { - nsCOMPtr intWin(do_QueryInterface(mScriptGlobal)); - if (intWin) - intWin->GetFrameElement(getter_AddRefs(requestingElement)); -#ifdef DEBUG_riceman NS_ASSERTION(requestingElement, "A frame but no DOM element!?"); -#endif contentType = nsIContentPolicy::TYPE_SUBDOCUMENT; } else { contentType = nsIContentPolicy::TYPE_DOCUMENT;