mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Fixing tinderbox orange. Make caps work right again when dealing with a script global object that's not a window. r+sr=bzbarsky@mit.edu
This commit is contained in:
parent
8f6437f05a
commit
ded8422135
@ -1558,13 +1558,25 @@ nsScriptSecurityManager::CanExecuteScripts(JSContext* cx,
|
||||
//-- See if the current window allows JS execution
|
||||
nsIScriptContext *scriptContext = GetScriptContext(cx);
|
||||
if (!scriptContext) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsPIDOMWindow> window =
|
||||
do_QueryInterface(scriptContext->GetGlobalObject());
|
||||
if (!window) return NS_ERROR_FAILURE;
|
||||
nsIScriptGlobalObject *sgo = scriptContext->GetGlobalObject();
|
||||
|
||||
if (!sgo) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// window can be null here if we're running with a non-DOM window
|
||||
// as the script global (i.e. a XUL prototype document).
|
||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(sgo);
|
||||
nsCOMPtr<nsIDocShell> docshell;
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIDocShell> docshell = window->GetDocShell();
|
||||
nsCOMPtr<nsIDocShellTreeItem> globalObjTreeItem = do_QueryInterface(docshell);
|
||||
|
||||
if (window) {
|
||||
docshell = window->GetDocShell();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> globalObjTreeItem =
|
||||
do_QueryInterface(docshell);
|
||||
|
||||
if (globalObjTreeItem)
|
||||
{
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(globalObjTreeItem);
|
||||
|
Loading…
Reference in New Issue
Block a user