Fixing bug 316794. Moving HandleDOMEvent() and Get/SetDocShell from nsIScriptGlobalObject to nsPIDOMWindow. r=mrbkap@gmail.com, sr=peterv@propagandism.org
git-svn-id: svn://10.0.0.236/trunk@185351 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -77,7 +77,6 @@
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsIWebShellServices.h"
|
||||
#include "nsIDocumentLoader.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsContentList.h"
|
||||
@@ -1830,8 +1829,7 @@ nsHTMLDocument::SetCookie(const nsAString& aCookie)
|
||||
nsCOMPtr<nsICookieService> service = do_GetService(kCookieServiceCID);
|
||||
if (service && mDocumentURI) {
|
||||
nsCOMPtr<nsIPrompt> prompt;
|
||||
nsCOMPtr<nsIDOMWindowInternal> window =
|
||||
do_QueryInterface(GetScriptGlobalObject());
|
||||
nsCOMPtr<nsPIDOMWindow> window = GetWindow();
|
||||
if (window) {
|
||||
window->GetPrompter(getter_AddRefs(prompt));
|
||||
}
|
||||
@@ -3559,10 +3557,11 @@ NS_IMETHODIMP
|
||||
nsHTMLDocument::SetDesignMode(const nsAString & aDesignMode)
|
||||
{
|
||||
// get editing session
|
||||
if (!mScriptGlobalObject)
|
||||
nsPIDOMWindow *window = GetWindow();
|
||||
if (!window)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsIDocShell *docshell = mScriptGlobalObject->GetDocShell();
|
||||
nsIDocShell *docshell = window->GetDocShell();
|
||||
if (!docshell)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
@@ -3584,9 +3583,6 @@ nsHTMLDocument::SetDesignMode(const nsAString & aDesignMode)
|
||||
if (!editSession)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsIDOMWindow *window = GetWindow();
|
||||
NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
|
||||
|
||||
if (aDesignMode.LowerCaseEqualsLiteral("on") && !mEditingIsOn) {
|
||||
rv = editSession->MakeWindowEditable(window, "html", PR_FALSE);
|
||||
|
||||
@@ -3634,10 +3630,12 @@ nsHTMLDocument::GetMidasCommandManager(nsICommandManager** aCmdMgr)
|
||||
}
|
||||
|
||||
*aCmdMgr = nsnull;
|
||||
if (!mScriptGlobalObject)
|
||||
|
||||
nsPIDOMWindow *window = GetWindow();
|
||||
if (!window)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsIDocShell *docshell = mScriptGlobalObject->GetDocShell();
|
||||
nsIDocShell *docshell = window->GetDocShell();
|
||||
if (!docshell)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user