From d73251183ec0483b9bf64e5e22444447e58476fc Mon Sep 17 00:00:00 2001 From: "jst%mozilla.jstenback.com" Date: Tue, 16 Mar 2004 19:06:10 +0000 Subject: [PATCH] Backing out the fix for bug 235457 since it made typing URLs, and autocomplete in the the URL bar not work. git-svn-id: svn://10.0.0.236/trunk@154028 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/caps/src/nsScriptSecurityManager.cpp | 9 ++++---- mozilla/dom/src/base/nsGlobalWindow.cpp | 23 ------------------- .../browser/resources/content/navigator.js | 5 +--- 3 files changed, 6 insertions(+), 31 deletions(-) diff --git a/mozilla/caps/src/nsScriptSecurityManager.cpp b/mozilla/caps/src/nsScriptSecurityManager.cpp index 6841aae551e..c61bd598a9e 100644 --- a/mozilla/caps/src/nsScriptSecurityManager.cpp +++ b/mozilla/caps/src/nsScriptSecurityManager.cpp @@ -1990,15 +1990,16 @@ nsScriptSecurityManager::IsCapabilityEnabled(const char *capability, nsresult rv; JSStackFrame *fp = nsnull; JSContext *cx = GetCurrentJSContext(); - if (!cx) + fp = cx ? JS_FrameIterator(cx, &fp) : nsnull; + if (!fp) { - // No context reachable. Allow execution. + // No script code on stack. Allow execution. *result = PR_TRUE; return NS_OK; } *result = PR_FALSE; nsCOMPtr previousPrincipal; - while ((fp = JS_FrameIterator(cx, &fp)) != nsnull) + do { nsCOMPtr principal; if (NS_FAILED(GetFramePrincipal(cx, fp, getter_AddRefs(principal)))) @@ -2030,7 +2031,7 @@ nsScriptSecurityManager::IsCapabilityEnabled(const char *capability, if (NS_FAILED(rv)) return rv; if (*result) return NS_OK; - } + } while ((fp = JS_FrameIterator(cx, &fp)) != nsnull); if (!previousPrincipal) { diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index e8e095ff45a..44773e33696 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -3356,31 +3356,8 @@ GlobalWindowImpl::Open(nsIDOMWindow **_retval) return NS_OK; // don't open the window, but also don't throw a JS exception } - // If we're called from chrome, push our context onto the context - // stack. This is so that opening a window from chrome by calling - // open() on a non-chrome window doesn't allow chrome-only features - // on the new window (opened through this non-chrome window). - nsCOMPtr stack; - - if (IsCallerChrome() && mContext) { - stack = do_GetService(sJSStackContractID); - - JSContext *my_cx = NS_REINTERPRET_CAST(JSContext *, - mContext->GetNativeContext()); - - if (stack && my_cx) { - stack->Push(my_cx); - } else { - stack = nsnull; - } - } - rv = OpenInternal(url, name, options, PR_FALSE, nsnull, 0, nsnull, _retval); - if (stack) { - stack->Pop(nsnull); - } - nsCOMPtr chrome_win(do_QueryInterface(*_retval)); if (NS_SUCCEEDED(rv)) { diff --git a/mozilla/xpfe/browser/resources/content/navigator.js b/mozilla/xpfe/browser/resources/content/navigator.js index 89fcd038d6f..70d7751c47c 100644 --- a/mozilla/xpfe/browser/resources/content/navigator.js +++ b/mozilla/xpfe/browser/resources/content/navigator.js @@ -2239,10 +2239,7 @@ function createShowPopupsMenu(parent) { function popupBlockerMenuCommand(target) { var uri = target.getAttribute("uri"); if (uri) { - // Make sure we use the content window to open the popup to - // prevent it from being able to set flags it shoudn't be able to - // set. - window.content.open(uri, "", target.getAttribute("features")); + window.open(uri, "", target.getAttribute("features")); } }