Backing out my checkin to see if it fixes the Txul breakage

This commit is contained in:
harishd%netscape.com 2002-06-27 23:32:51 +00:00
Родитель 0a18677404
Коммит 7be79a0d54
2 изменённых файлов: 7 добавлений и 24 удалений

Просмотреть файл

@ -1369,7 +1369,7 @@ nsScriptSecurityManager::GetRootDocShell(JSContext *cx, nsIDocShell **result)
if (!scriptContext) return NS_ERROR_FAILURE;
nsCOMPtr<nsIScriptGlobalObject> globalObject;
scriptContext->GetGlobalObject(getter_AddRefs(globalObject));
if (!globalObject) return NS_ERROR_FAILURE;
if (!globalObject) return NS_ERROR_FAILURE;
rv = globalObject->GetDocShell(getter_AddRefs(docshell));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIDocShellTreeItem> docshellTreeItem(do_QueryInterface(docshell, &rv));
@ -1415,32 +1415,15 @@ nsScriptSecurityManager::CanExecuteScripts(JSContext* cx,
}
//-- See if the current window allows JS execution
nsCOMPtr<nsIScriptContext> scriptContext = (nsIScriptContext*)JS_GetContextPrivate(cx);
if (!scriptContext) return NS_ERROR_FAILURE;
nsCOMPtr<nsIScriptGlobalObject> globalObject;
scriptContext->GetGlobalObject(getter_AddRefs(globalObject));
if (!globalObject) return NS_ERROR_FAILURE;
nsCOMPtr<nsIDocShell> docshell;
rv = globalObject->GetDocShell(getter_AddRefs(docshell));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(docshell));
if (!treeItem) return NS_ERROR_UNEXPECTED;
nsCOMPtr<nsIDocShellTreeItem> parentItem;
// Walk up the docshell tree to see if any containing docshell disallows scripts
do {
rv = GetRootDocShell(cx, getter_AddRefs(docshell));
if (NS_SUCCEEDED(rv))
{
rv = docshell->GetAllowJavascript(result);
if (NS_FAILED(rv)) return rv;
if (!*result)
return NS_OK; // Do not run scripts
rv = treeItem->GetParent(getter_AddRefs(parentItem));
if (NS_FAILED(rv)) return rv;
if (parentItem)
{
treeItem = parentItem;
docshell = do_QueryInterface(treeItem, &rv);
if (NS_FAILED(rv)) return rv;
}
} while (parentItem);
return NS_OK;
}
//-- See if JS is disabled globally (via prefs)
*result = mIsJavaScriptEnabled;

Просмотреть файл

@ -145,7 +145,7 @@ interface nsIDocShell : nsISupports
* document. Note if you want to get the current URI, use the read-only
* property on nsIWebNavigation.
*/
void setCurrentURI(in nsIURI aURI);
[noscript] void setCurrentURI(in nsIURI aURI);
/**
* Notify the associated content viewer and all child docshells that they are