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
git-svn-id: svn://10.0.0.236/trunk@185368 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
09c35fcab1
commit
2a67af918b
@ -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…
x
Reference in New Issue
Block a user