From 032eb36af18ab6516bf8399b95370b4fd451a41c 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 git-svn-id: svn://10.0.0.236/trunk@159441 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 9231db46a9a..e268718196a 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/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;