mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Backing out the fix for bug 235457 since it made typing URLs, and autocomplete in the the URL bar not work.
This commit is contained in:
parent
7c70a6cb04
commit
2ee27045ba
@ -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<nsIPrincipal> previousPrincipal;
|
||||
while ((fp = JS_FrameIterator(cx, &fp)) != nsnull)
|
||||
do
|
||||
{
|
||||
nsCOMPtr<nsIPrincipal> 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)
|
||||
{
|
||||
|
@ -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<nsIJSContextStack> 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<nsIDOMChromeWindow> chrome_win(do_QueryInterface(*_retval));
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user