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:
jst%mozilla.jstenback.com
2005-11-28 23:56:44 +00:00
parent e4c5fe4567
commit 895df6e6ca
125 changed files with 882 additions and 1124 deletions

View File

@@ -55,8 +55,6 @@
#include "nsReadableUtils.h"
#include "nsEscape.h"
#include "nsIScriptGlobalObject.h"
#include "nsIDOMWindowInternal.h"
#include "nsPIDOMWindow.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMFocusListener.h"
@@ -81,10 +79,6 @@
#include "nsIMenuListener.h"
#include "nsITimer.h"
// For JS Execution
#include "nsIScriptGlobalObjectOwner.h"
#include "nsIJSContextStack.h"
#include "nsIEventQueueService.h"
#include "plevent.h"
#include "prmem.h"
@@ -799,9 +793,9 @@ PRBool nsWebShellWindow::ExecuteCloseHandler()
than it otherwise would.) */
nsCOMPtr<nsIXULWindow> kungFuDeathGrip(this);
nsCOMPtr<nsIScriptGlobalObject> globalObject(do_GetInterface(mDocShell));
nsCOMPtr<nsPIDOMWindow> window(do_GetInterface(mDocShell));
if (globalObject) {
if (window) {
nsCOMPtr<nsIContentViewer> contentViewer;
mDocShell->GetContentViewer(getter_AddRefs(contentViewer));
nsCOMPtr<nsIDocumentViewer> docViewer(do_QueryInterface(contentViewer));
@@ -814,8 +808,8 @@ PRBool nsWebShellWindow::ExecuteCloseHandler()
nsMouseEvent event(PR_TRUE, NS_XUL_CLOSE, nsnull,
nsMouseEvent::eReal);
nsresult rv = globalObject->HandleDOMEvent(presContext, &event, nsnull,
NS_EVENT_FLAG_INIT, &status);
nsresult rv = window->HandleDOMEvent(presContext, &event, nsnull,
NS_EVENT_FLAG_INIT, &status);
if (NS_SUCCEEDED(rv) && status == nsEventStatus_eConsumeNoDefault)
return PR_TRUE;
// else fall through and return PR_FALSE