2001-09-25 22:43:09 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-17 21:52:36 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-07-24 05:05:42 +00:00
|
|
|
*
|
2004-04-17 21:52:36 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
1998-07-24 05:05:42 +00:00
|
|
|
*
|
2001-09-25 22:43:09 +00:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1998-07-24 05:05:42 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-17 21:52:36 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-25 22:43:09 +00:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 03:40:37 +00:00
|
|
|
*
|
2000-02-08 13:40:10 +00:00
|
|
|
* Contributor(s):
|
2001-04-18 06:06:31 +00:00
|
|
|
* Travis Bogard <travis@netscape.com>
|
|
|
|
* Dan Rosen <dr@netscape.com>
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
* Vidur Apparao <vidur@netscape.com>
|
|
|
|
* Johnny Stenback <jst@netscape.com>
|
2001-09-25 22:43:09 +00:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-17 21:52:36 +00:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-25 22:43:09 +00:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-17 21:52:36 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-25 22:43:09 +00:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-17 21:52:36 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-25 22:43:09 +00:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2001-04-18 06:06:31 +00:00
|
|
|
|
1998-07-24 05:05:42 +00:00
|
|
|
#ifndef nsGlobalWindow_h___
|
|
|
|
#define nsGlobalWindow_h___
|
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
// Local Includes
|
|
|
|
// Helper Classes
|
1999-10-14 10:58:25 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2003-06-20 23:51:46 +00:00
|
|
|
#include "nsAutoPtr.h"
|
2000-05-14 05:26:06 +00:00
|
|
|
#include "nsWeakReference.h"
|
2000-03-24 00:11:48 +00:00
|
|
|
#include "nsHashtable.h"
|
2000-02-08 13:40:10 +00:00
|
|
|
|
|
|
|
// Interfaces Needed
|
|
|
|
#include "nsDOMWindowList.h"
|
|
|
|
#include "nsIBaseWindow.h"
|
|
|
|
#include "nsIChromeEventHandler.h"
|
|
|
|
#include "nsIControllers.h"
|
2002-11-25 23:21:25 +00:00
|
|
|
#include "nsIObserver.h"
|
2000-02-08 13:40:10 +00:00
|
|
|
#include "nsIDocShellTreeOwner.h"
|
|
|
|
#include "nsIDocShellTreeItem.h"
|
2000-05-03 13:03:17 +00:00
|
|
|
#include "nsIDOMViewCSS.h"
|
1999-09-21 14:18:52 +00:00
|
|
|
#include "nsIDOMEventReceiver.h"
|
2002-11-09 00:25:25 +00:00
|
|
|
#include "nsIDOM3EventTarget.h"
|
2000-02-08 13:40:10 +00:00
|
|
|
#include "nsIDOMNavigator.h"
|
1999-08-03 23:16:48 +00:00
|
|
|
#include "nsIDOMNSLocation.h"
|
2000-09-01 01:54:35 +00:00
|
|
|
#include "nsIDOMWindowInternal.h"
|
2001-05-17 02:15:27 +00:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2001-09-05 21:28:38 +00:00
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
#include "nsIDOMJSWindow.h"
|
2002-02-09 03:36:55 +00:00
|
|
|
#include "nsIDOMChromeWindow.h"
|
2000-02-08 13:40:10 +00:00
|
|
|
#include "nsIScriptGlobalObject.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
#include "nsIScriptObjectPrincipal.h"
|
2000-02-08 13:40:10 +00:00
|
|
|
#include "nsITimer.h"
|
|
|
|
#include "nsIWebBrowserChrome.h"
|
1999-10-14 10:58:25 +00:00
|
|
|
#include "nsPIDOMWindow.h"
|
2003-06-26 00:41:23 +00:00
|
|
|
#include "nsIScriptSecurityManager.h"
|
2000-02-09 05:26:02 +00:00
|
|
|
#include "nsIEventListenerManager.h"
|
|
|
|
#include "nsIDOMDocument.h"
|
2000-05-11 19:17:07 +00:00
|
|
|
#include "nsIDOMCrypto.h"
|
|
|
|
#include "nsIDOMPkcs11.h"
|
2000-07-13 21:48:25 +00:00
|
|
|
#include "nsIPrincipal.h"
|
2001-01-23 22:29:41 +00:00
|
|
|
#include "nsPluginArray.h"
|
2001-07-23 05:36:52 +00:00
|
|
|
#include "nsMimeTypeArray.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
#include "nsIXPCScriptable.h"
|
2002-02-20 03:33:52 +00:00
|
|
|
#include "nsPoint.h"
|
|
|
|
#include "nsSize.h"
|
2004-05-27 22:08:42 +00:00
|
|
|
#include "mozFlushType.h"
|
1998-07-24 05:05:42 +00:00
|
|
|
|
1999-04-28 20:33:43 +00:00
|
|
|
#define DEFAULT_HOME_PAGE "www.mozilla.org"
|
|
|
|
#define PREF_BROWSER_STARTUP_HOMEPAGE "browser.startup.homepage"
|
|
|
|
|
1999-06-09 19:04:18 +00:00
|
|
|
class nsIDOMBarProp;
|
1999-05-27 21:06:51 +00:00
|
|
|
class nsIDocument;
|
1999-09-21 01:05:01 +00:00
|
|
|
class nsIContent;
|
1998-07-24 05:05:42 +00:00
|
|
|
class nsIPresContext;
|
|
|
|
class nsIDOMEvent;
|
1999-10-06 22:07:42 +00:00
|
|
|
class nsIScrollableView;
|
1998-07-24 05:05:42 +00:00
|
|
|
|
|
|
|
typedef struct nsTimeoutImpl nsTimeoutImpl;
|
|
|
|
|
1999-06-09 19:04:18 +00:00
|
|
|
class BarPropImpl;
|
1998-08-13 04:34:53 +00:00
|
|
|
class LocationImpl;
|
|
|
|
class NavigatorImpl;
|
1999-01-28 23:12:54 +00:00
|
|
|
class ScreenImpl;
|
|
|
|
class HistoryImpl;
|
2000-08-11 04:31:08 +00:00
|
|
|
class nsIDocShellLoadInfo;
|
1998-08-13 04:34:53 +00:00
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
//*****************************************************************************
|
|
|
|
// GlobalWindowImpl: Global Object for Scripting
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
//*****************************************************************************
|
2001-07-24 22:39:11 +00:00
|
|
|
// Beware that all scriptable interfaces implemented by
|
|
|
|
// GlobalWindowImpl will be reachable from JS, if you make this class
|
|
|
|
// implement new interfaces you better know what you're
|
|
|
|
// doing. Security wise this is very sensitive code. --
|
|
|
|
// jst@netscape.com
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
class GlobalWindowImpl : public nsIScriptGlobalObject,
|
2004-05-03 21:48:36 +00:00
|
|
|
public nsPIDOMWindow,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
public nsIDOMJSWindow,
|
2001-01-18 07:44:29 +00:00
|
|
|
public nsIScriptObjectPrincipal,
|
|
|
|
public nsIDOMEventReceiver,
|
2002-11-09 00:25:25 +00:00
|
|
|
public nsIDOM3EventTarget,
|
2001-01-18 07:44:29 +00:00
|
|
|
public nsIDOMViewCSS,
|
2001-05-17 02:15:27 +00:00
|
|
|
public nsSupportsWeakReference,
|
|
|
|
public nsIInterfaceRequestor
|
1998-07-24 05:05:42 +00:00
|
|
|
{
|
|
|
|
public:
|
2004-05-03 21:48:36 +00:00
|
|
|
// public methods
|
|
|
|
nsPIDOMWindow* GetPrivateParent();
|
|
|
|
// callback for close event
|
|
|
|
void ReallyCloseWindow();
|
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// nsIScriptGlobalObject
|
2004-02-09 22:48:53 +00:00
|
|
|
virtual void SetContext(nsIScriptContext *aContext);
|
|
|
|
virtual nsIScriptContext *GetContext();
|
|
|
|
virtual nsresult SetNewDocument(nsIDOMDocument *aDocument,
|
|
|
|
PRBool aRemoveEventListeners,
|
|
|
|
PRBool aClearScopeHint);
|
|
|
|
virtual void SetDocShell(nsIDocShell* aDocShell);
|
|
|
|
virtual nsIDocShell *GetDocShell();
|
|
|
|
virtual void SetOpenerWindow(nsIDOMWindowInternal *aOpener);
|
|
|
|
virtual void SetGlobalObjectOwner(nsIScriptGlobalObjectOwner* aOwner);
|
|
|
|
virtual nsIScriptGlobalObjectOwner *GetGlobalObjectOwner();
|
|
|
|
virtual nsresult HandleDOMEvent(nsIPresContext* aPresContext,
|
|
|
|
nsEvent* aEvent, nsIDOMEvent** aDOMEvent,
|
|
|
|
PRUint32 aFlags,
|
|
|
|
nsEventStatus* aEventStatus);
|
|
|
|
virtual JSObject *GetGlobalJSObject();
|
|
|
|
virtual void OnFinalize(JSObject *aJSObject);
|
|
|
|
virtual void SetScriptsEnabled(PRBool aEnabled, PRBool aFireTimeouts);
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// nsIScriptObjectPrincipal
|
2004-04-18 00:28:47 +00:00
|
|
|
virtual nsIPrincipal* GetPrincipal();
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// nsIDOMWindow
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMWINDOW
|
2001-01-18 07:44:29 +00:00
|
|
|
|
2004-05-26 18:10:47 +00:00
|
|
|
// nsIDOMWindow2
|
|
|
|
NS_DECL_NSIDOMWINDOW2
|
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
// nsIDOMWindowInternal
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMWINDOWINTERNAL
|
|
|
|
|
|
|
|
// nsIDOMJSWindow
|
|
|
|
NS_DECL_NSIDOMJSWINDOW
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// nsIDOMEventTarget
|
2002-11-09 00:25:25 +00:00
|
|
|
NS_DECL_NSIDOMEVENTTARGET
|
|
|
|
|
|
|
|
// nsIDOM3EventTarget
|
|
|
|
NS_DECL_NSIDOM3EVENTTARGET
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// nsIDOMEventReceiver
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD AddEventListenerByIID(nsIDOMEventListener *aListener,
|
2001-01-18 07:44:29 +00:00
|
|
|
const nsIID& aIID);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD RemoveEventListenerByIID(nsIDOMEventListener *aListener,
|
2001-01-18 07:44:29 +00:00
|
|
|
const nsIID& aIID);
|
|
|
|
NS_IMETHOD GetListenerManager(nsIEventListenerManager** aInstancePtrResult);
|
|
|
|
NS_IMETHOD HandleEvent(nsIDOMEvent *aEvent);
|
2002-11-09 00:25:25 +00:00
|
|
|
NS_IMETHOD GetSystemEventGroup(nsIDOMEventGroup** aGroup);
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// nsPIDOMWindow
|
2004-05-03 21:48:36 +00:00
|
|
|
virtual NS_HIDDEN_(nsPIDOMWindow*) GetPrivateRoot();
|
|
|
|
virtual NS_HIDDEN_(nsresult) GetObjectProperty(const PRUnichar* aProperty,
|
|
|
|
nsISupports** aObject);
|
|
|
|
virtual NS_HIDDEN_(nsresult) Activate();
|
|
|
|
virtual NS_HIDDEN_(nsresult) Deactivate();
|
|
|
|
virtual NS_HIDDEN_(nsIFocusController*) GetRootFocusController();
|
|
|
|
|
|
|
|
virtual NS_HIDDEN_(void) SetOpenerScriptURL(nsIURI* aURI);
|
2002-04-17 04:17:16 +00:00
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
// nsIDOMViewCSS
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMVIEWCSS
|
2000-05-03 13:03:17 +00:00
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
// nsIDOMAbstractView
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMABSTRACTVIEW
|
2000-02-08 13:40:10 +00:00
|
|
|
|
2001-05-17 02:15:27 +00:00
|
|
|
// nsIInterfaceRequestor
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
// Object Management
|
|
|
|
GlobalWindowImpl();
|
2000-02-08 13:40:10 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
static void ShutDown();
|
2002-06-19 04:09:57 +00:00
|
|
|
static PRBool IsCallerChrome();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
protected:
|
2001-01-18 07:44:29 +00:00
|
|
|
// Object Management
|
|
|
|
virtual ~GlobalWindowImpl();
|
|
|
|
void CleanUp();
|
2002-12-20 08:00:08 +00:00
|
|
|
void ClearControllers();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2001-10-31 23:52:52 +00:00
|
|
|
// Get the parent, returns null if this is a toplevel window
|
2004-02-09 22:48:53 +00:00
|
|
|
nsIDOMWindowInternal *GetParentInternal();
|
2001-10-31 23:52:52 +00:00
|
|
|
|
2004-05-03 21:48:36 +00:00
|
|
|
// popup tracking
|
|
|
|
PRBool IsPopupSpamWindow() const { return mIsPopupSpam; }
|
|
|
|
void SetPopupSpamWindow(PRBool aPopup) { mIsPopupSpam = aPopup; }
|
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
// Window Control Functions
|
2002-03-24 00:16:18 +00:00
|
|
|
NS_IMETHOD OpenInternal(const nsAString& aUrl,
|
|
|
|
const nsAString& aName,
|
|
|
|
const nsAString& aOptions,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
PRBool aDialog, jsval *argv, PRUint32 argc,
|
|
|
|
nsISupports *aExtraArgument, nsIDOMWindow **aReturn);
|
2001-01-18 07:44:29 +00:00
|
|
|
static void CloseWindow(nsISupports* aWindow);
|
|
|
|
|
|
|
|
// Timeout Functions
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
nsresult SetTimeoutOrInterval(PRBool aIsInterval, PRInt32* aReturn);
|
2001-08-15 05:35:02 +00:00
|
|
|
void RunTimeout(nsTimeoutImpl *aTimeout);
|
2002-03-27 00:55:57 +00:00
|
|
|
nsresult ClearTimeoutOrInterval();
|
2001-01-18 07:44:29 +00:00
|
|
|
void ClearAllTimeouts();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
void InsertTimeoutIntoList(nsTimeoutImpl **aInsertionPoint,
|
2001-01-18 07:44:29 +00:00
|
|
|
nsTimeoutImpl *aTimeout);
|
2001-10-24 06:58:11 +00:00
|
|
|
static void TimerCallback(nsITimer *aTimer, void *aClosure);
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// Helper Functions
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
nsresult GetTreeOwner(nsIDocShellTreeOwner** aTreeOwner);
|
|
|
|
nsresult GetTreeOwner(nsIBaseWindow** aTreeOwner);
|
|
|
|
nsresult GetWebBrowserChrome(nsIWebBrowserChrome** aBrowserChrome);
|
|
|
|
nsresult GetScrollInfo(nsIScrollableView** aScrollableView, float* aP2T,
|
|
|
|
float* aT2P);
|
2001-06-20 01:25:09 +00:00
|
|
|
nsresult SecurityCheckURL(const char *aURL);
|
2004-02-03 02:22:54 +00:00
|
|
|
PRUint32 CheckForAbusePoint();
|
2004-06-26 02:18:28 +00:00
|
|
|
PRUint32 CheckOpenAllow(PRUint32 aAbuseLevel, const nsAString &aName);
|
2003-06-25 23:38:45 +00:00
|
|
|
void FireAbuseEvents(PRBool aBlocked, PRBool aWindow,
|
2004-02-10 18:22:23 +00:00
|
|
|
const nsAString &aPopupURL,
|
|
|
|
const nsAString &aPopupWindowFeatures);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2004-05-27 22:08:42 +00:00
|
|
|
void FlushPendingNotifications(mozFlushType aType);
|
2002-02-05 05:47:22 +00:00
|
|
|
void EnsureReflowFlushAndPaint();
|
2001-01-18 07:44:29 +00:00
|
|
|
nsresult CheckSecurityWidthAndHeight(PRInt32* width, PRInt32* height);
|
|
|
|
nsresult CheckSecurityLeftAndTop(PRInt32* left, PRInt32* top);
|
2002-11-25 23:21:25 +00:00
|
|
|
static PRBool CanSetProperty(const char *aPrefName);
|
2002-05-17 22:24:06 +00:00
|
|
|
|
2004-06-23 01:15:42 +00:00
|
|
|
static void MakeScriptDialogTitle(const nsAString &aInTitle,
|
|
|
|
nsAString &aOutTitle);
|
2000-02-08 13:40:10 +00:00
|
|
|
|
2001-09-30 19:56:32 +00:00
|
|
|
// Helper for window.find()
|
2002-03-24 00:16:18 +00:00
|
|
|
nsresult FindInternal(const nsAString& aStr, PRBool caseSensitive,
|
2001-09-30 19:56:32 +00:00
|
|
|
PRBool backwards, PRBool wrapAround, PRBool wholeWord,
|
|
|
|
PRBool searchInFrames, PRBool showDialog,
|
|
|
|
PRBool *aReturn);
|
|
|
|
|
2003-01-27 22:02:44 +00:00
|
|
|
nsresult ConvertCharset(const nsAString& aStr, char** aDest);
|
|
|
|
|
2003-02-24 20:15:59 +00:00
|
|
|
PRBool GetBlurSuppression();
|
|
|
|
|
2003-04-15 13:40:46 +00:00
|
|
|
nsresult GetScrollXY(PRInt32* aScrollX, PRInt32* aScrollY);
|
|
|
|
nsresult GetScrollMaxXY(PRInt32* aScrollMaxX, PRInt32* aScrollMaxY);
|
|
|
|
|
2004-07-05 15:51:31 +00:00
|
|
|
PRBool IsFrame()
|
|
|
|
{
|
|
|
|
return GetParentInternal() != nsnull;
|
|
|
|
}
|
|
|
|
|
1998-07-24 05:05:42 +00:00
|
|
|
protected:
|
2001-02-17 19:02:25 +00:00
|
|
|
// When adding new member variables, be careful not to create cycles
|
|
|
|
// through JavaScript. If there is any chance that a member variable
|
|
|
|
// could own objects that are implemented in JavaScript, then those
|
|
|
|
// objects will keep the global object (this object) alive. To prevent
|
|
|
|
// these cycles, ownership of such members must be released in
|
|
|
|
// |CleanUp| and |SetDocShell|.
|
2004-06-23 01:15:42 +00:00
|
|
|
PRPackedBool mFirstDocumentLoad;
|
|
|
|
PRPackedBool mIsScopeClear;
|
|
|
|
PRPackedBool mFullScreen;
|
|
|
|
PRPackedBool mIsClosed;
|
|
|
|
PRPackedBool mOpenerWasCleared;
|
|
|
|
PRPackedBool mIsPopupSpam;
|
2001-01-18 07:44:29 +00:00
|
|
|
nsCOMPtr<nsIScriptContext> mContext;
|
|
|
|
nsCOMPtr<nsIDOMWindowInternal> mOpener;
|
|
|
|
nsCOMPtr<nsIControllers> mControllers;
|
|
|
|
nsCOMPtr<nsIEventListenerManager> mListenerManager;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
JSObject* mJSObject;
|
2003-06-20 23:51:46 +00:00
|
|
|
nsRefPtr<NavigatorImpl> mNavigator;
|
|
|
|
nsRefPtr<ScreenImpl> mScreen;
|
|
|
|
nsRefPtr<HistoryImpl> mHistory;
|
|
|
|
nsRefPtr<nsDOMWindowList> mFrames;
|
|
|
|
nsRefPtr<LocationImpl> mLocation;
|
|
|
|
nsRefPtr<BarPropImpl> mMenubar;
|
|
|
|
nsRefPtr<BarPropImpl> mToolbar;
|
|
|
|
nsRefPtr<BarPropImpl> mLocationbar;
|
|
|
|
nsRefPtr<BarPropImpl> mPersonalbar;
|
|
|
|
nsRefPtr<BarPropImpl> mStatusbar;
|
|
|
|
nsRefPtr<BarPropImpl> mScrollbars;
|
2004-06-20 16:42:13 +00:00
|
|
|
nsCOMPtr<nsIWeakReference> mWindowUtils;
|
2001-01-18 07:44:29 +00:00
|
|
|
nsTimeoutImpl* mTimeouts;
|
|
|
|
nsTimeoutImpl** mTimeoutInsertionPoint;
|
|
|
|
PRUint32 mTimeoutPublicIdCounter;
|
|
|
|
PRUint32 mTimeoutFiringDepth;
|
2002-11-28 01:04:18 +00:00
|
|
|
PRTime mLastMouseButtonAction;
|
2001-01-18 07:44:29 +00:00
|
|
|
nsString mStatus;
|
|
|
|
nsString mDefaultStatus;
|
|
|
|
|
|
|
|
nsIScriptGlobalObjectOwner* mGlobalObjectOwner; // Weak Reference
|
|
|
|
nsIDocShell* mDocShell; // Weak Reference
|
2004-02-03 02:22:54 +00:00
|
|
|
nsEvent* mCurrentEvent;
|
2001-01-18 07:44:29 +00:00
|
|
|
nsCOMPtr<nsIDOMCrypto> mCrypto;
|
|
|
|
nsCOMPtr<nsIDOMPkcs11> mPkcs11;
|
|
|
|
nsCOMPtr<nsIPrincipal> mDocumentPrincipal;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2003-06-18 23:48:57 +00:00
|
|
|
// XXX We need mNavigatorHolder because we make two SetNewDocument()
|
|
|
|
// calls when transitioning from page to page. This keeps a reference
|
|
|
|
// to the JSObject holder for the navigator object in between
|
|
|
|
// SetNewDocument() calls so that the JSObject doesn't get garbage
|
|
|
|
// collected in between these calls.
|
|
|
|
// See bug 163645 for more on why we need this and bug 209607 for info
|
|
|
|
// on how we can remove the need for this.
|
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> mNavigatorHolder;
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
friend class nsDOMScriptableHelper;
|
2004-06-20 16:42:13 +00:00
|
|
|
friend class nsDOMWindowUtils;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
static nsIXPConnect *sXPConnect;
|
2002-05-17 22:24:06 +00:00
|
|
|
static nsIScriptSecurityManager *sSecMan;
|
2002-07-08 07:11:59 +00:00
|
|
|
static nsIFactory *sComputedDOMStyleFactory;
|
1998-07-24 05:05:42 +00:00
|
|
|
};
|
|
|
|
|
2002-02-09 03:36:55 +00:00
|
|
|
/*
|
|
|
|
* nsGlobalChromeWindow inherits from GlobalWindowImpl. It is the global
|
|
|
|
* object created for a Chrome Window only.
|
|
|
|
*/
|
|
|
|
class nsGlobalChromeWindow : public GlobalWindowImpl,
|
|
|
|
public nsIDOMChromeWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
// nsIDOMChromeWindow interface
|
|
|
|
NS_DECL_NSIDOMCHROMEWINDOW
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsresult GetMainWidget(nsIWidget** aMainWidget);
|
|
|
|
|
|
|
|
nsString mTitle;
|
|
|
|
};
|
|
|
|
|
2001-02-15 05:07:46 +00:00
|
|
|
/*
|
1998-07-24 05:05:42 +00:00
|
|
|
* Timeout struct that holds information about each JavaScript
|
|
|
|
* timeout.
|
|
|
|
*/
|
2002-11-28 01:04:18 +00:00
|
|
|
struct nsTimeoutImpl
|
|
|
|
{
|
|
|
|
nsTimeoutImpl()
|
|
|
|
{
|
2002-12-12 22:37:07 +00:00
|
|
|
#ifdef DEBUG_jst
|
|
|
|
{
|
2004-04-29 23:34:19 +00:00
|
|
|
extern int gTimeoutCnt;
|
2002-12-12 22:37:07 +00:00
|
|
|
|
|
|
|
++gTimeoutCnt;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2001-08-15 05:35:02 +00:00
|
|
|
memset(this, 0, sizeof(*this));
|
|
|
|
|
|
|
|
MOZ_COUNT_CTOR(nsTimeoutImpl);
|
|
|
|
}
|
|
|
|
|
2002-11-28 01:04:18 +00:00
|
|
|
~nsTimeoutImpl()
|
|
|
|
{
|
2002-12-12 22:37:07 +00:00
|
|
|
#ifdef DEBUG_jst
|
|
|
|
{
|
2004-04-29 23:34:19 +00:00
|
|
|
extern int gTimeoutCnt;
|
2002-12-12 22:37:07 +00:00
|
|
|
|
|
|
|
--gTimeoutCnt;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2001-08-15 05:35:02 +00:00
|
|
|
MOZ_COUNT_DTOR(nsTimeoutImpl);
|
|
|
|
}
|
|
|
|
|
2002-11-28 01:04:18 +00:00
|
|
|
void Release(nsIScriptContext* aContext);
|
|
|
|
void AddRef();
|
|
|
|
|
2002-11-28 01:35:45 +00:00
|
|
|
// Window for which this timeout fires
|
|
|
|
GlobalWindowImpl *mWindow;
|
|
|
|
|
|
|
|
// The JS expression to evaluate or function to call, if !mExpr
|
|
|
|
JSString *mExpr;
|
|
|
|
JSObject *mFunObj;
|
|
|
|
|
|
|
|
// The actual timer object
|
|
|
|
nsCOMPtr<nsITimer> mTimer;
|
|
|
|
|
|
|
|
// Function actual arguments and argument count
|
|
|
|
jsval *mArgv;
|
|
|
|
PRUint16 mArgc;
|
|
|
|
|
|
|
|
// True if the timeout was cleared
|
|
|
|
PRPackedBool mCleared;
|
|
|
|
|
2003-08-01 03:40:24 +00:00
|
|
|
// True if this is one of the timeouts that are currently running
|
|
|
|
PRPackedBool mRunning;
|
2002-11-28 01:35:45 +00:00
|
|
|
|
|
|
|
// Returned as value of setTimeout()
|
|
|
|
PRUint32 mPublicId;
|
|
|
|
|
|
|
|
// Non-zero if repetitive timeout
|
|
|
|
PRInt32 mInterval;
|
|
|
|
|
|
|
|
// Nominal time to run this timeout
|
|
|
|
PRInt64 mWhen;
|
|
|
|
|
|
|
|
// Principal with which to execute
|
|
|
|
nsCOMPtr<nsIPrincipal> mPrincipal;
|
|
|
|
|
|
|
|
// filename, line number and JS language version string of the
|
|
|
|
// caller of setTimeout()
|
|
|
|
char *mFileName;
|
|
|
|
PRUint32 mLineNo;
|
|
|
|
const char *mVersion;
|
|
|
|
|
|
|
|
// stack depth at which timeout is firing
|
|
|
|
PRUint32 mFiringDepth;
|
|
|
|
|
|
|
|
// Pointer to the next timeout in the linked list of scheduled
|
|
|
|
// timeouts
|
|
|
|
nsTimeoutImpl *mNext;
|
2002-11-28 01:04:18 +00:00
|
|
|
|
|
|
|
private:
|
2002-11-28 01:35:45 +00:00
|
|
|
// reference count for shared usage
|
|
|
|
PRInt32 mRefCnt;
|
1998-07-24 05:05:42 +00:00
|
|
|
};
|
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
//*****************************************************************************
|
|
|
|
// NavigatorImpl: Script "navigator" object
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
//*****************************************************************************
|
1998-07-24 05:05:42 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
class NavigatorImpl : public nsIDOMNavigator,
|
|
|
|
public nsIDOMJSNavigator
|
2000-02-08 13:40:10 +00:00
|
|
|
{
|
1998-07-24 05:05:42 +00:00
|
|
|
public:
|
2001-01-23 22:29:41 +00:00
|
|
|
NavigatorImpl(nsIDocShell *aDocShell);
|
2001-01-18 07:44:29 +00:00
|
|
|
virtual ~NavigatorImpl();
|
2000-02-08 13:40:10 +00:00
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
NS_DECL_ISUPPORTS
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMNAVIGATOR
|
|
|
|
NS_DECL_NSIDOMJSNAVIGATOR
|
2001-07-23 05:36:52 +00:00
|
|
|
|
2001-01-23 22:29:41 +00:00
|
|
|
void SetDocShell(nsIDocShell *aDocShell);
|
2003-06-18 23:48:57 +00:00
|
|
|
void LoadingNewDocument();
|
2001-07-23 05:36:52 +00:00
|
|
|
nsresult RefreshMIMEArray();
|
2001-01-23 22:29:41 +00:00
|
|
|
|
1998-07-24 05:05:42 +00:00
|
|
|
protected:
|
2003-06-20 23:51:46 +00:00
|
|
|
nsRefPtr<MimeTypeArrayImpl> mMimeTypes;
|
|
|
|
nsRefPtr<PluginArrayImpl> mPlugins;
|
2001-01-23 22:29:41 +00:00
|
|
|
nsIDocShell* mDocShell; // weak reference
|
2002-02-13 04:20:46 +00:00
|
|
|
|
|
|
|
static jsval sPrefInternal_id;
|
1998-07-24 05:05:42 +00:00
|
|
|
};
|
|
|
|
|
1999-06-23 03:29:44 +00:00
|
|
|
class nsIURI;
|
1998-12-16 05:40:20 +00:00
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
//*****************************************************************************
|
|
|
|
// LocationImpl: Script "location" object
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
//*****************************************************************************
|
2000-02-08 13:40:10 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
class LocationImpl : public nsIDOMLocation,
|
|
|
|
public nsIDOMNSLocation
|
1999-08-03 23:16:48 +00:00
|
|
|
{
|
1998-08-13 04:34:53 +00:00
|
|
|
public:
|
2001-01-18 07:44:29 +00:00
|
|
|
LocationImpl(nsIDocShell *aDocShell);
|
|
|
|
virtual ~LocationImpl();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2004-02-09 22:48:53 +00:00
|
|
|
void SetDocShell(nsIDocShell *aDocShell);
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// nsIDOMLocation
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMLOCATION
|
2001-01-18 07:44:29 +00:00
|
|
|
|
|
|
|
// nsIDOMNSLocation
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMNSLOCATION
|
2001-01-18 07:44:29 +00:00
|
|
|
|
1998-08-13 04:34:53 +00:00
|
|
|
protected:
|
2004-04-24 16:09:31 +00:00
|
|
|
// In the case of jar: uris, we sometimes want the place the jar was
|
|
|
|
// fetched from as the URI instead of the jar: uri itself. Pass in
|
|
|
|
// PR_TRUE for aGetInnermostURI when that's the case.
|
|
|
|
nsresult GetURI(nsIURI** aURL, PRBool aGetInnermostURI = PR_FALSE);
|
2002-03-06 07:48:55 +00:00
|
|
|
nsresult GetWritableURI(nsIURI** aURL);
|
|
|
|
nsresult SetURI(nsIURI* aURL);
|
2002-03-24 00:16:18 +00:00
|
|
|
nsresult SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
|
1999-08-03 23:16:48 +00:00
|
|
|
PRBool aReplace);
|
2002-03-24 00:16:18 +00:00
|
|
|
nsresult SetHrefWithContext(JSContext* cx, const nsAString& aHref,
|
2001-05-15 20:58:31 +00:00
|
|
|
PRBool aReplace);
|
|
|
|
|
2001-11-17 17:26:18 +00:00
|
|
|
nsresult GetSourceURL(JSContext* cx, nsIURI** sourceURL);
|
|
|
|
nsresult GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL);
|
|
|
|
nsresult GetSourceDocument(JSContext* cx, nsIDocument** aDocument);
|
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
nsresult CheckURL(nsIURI *url, nsIDocShellLoadInfo** aLoadInfo);
|
2003-03-05 22:23:47 +00:00
|
|
|
nsresult FindUsableBaseURI(nsIURI * aBaseURI, nsIDocShell * aParent, nsIURI ** aUsableURI);
|
1998-08-13 04:34:53 +00:00
|
|
|
|
2001-01-18 07:44:29 +00:00
|
|
|
nsIDocShell *mDocShell; // Weak Reference
|
1998-08-13 04:34:53 +00:00
|
|
|
};
|
|
|
|
|
2004-02-24 03:22:35 +00:00
|
|
|
/* factory function */
|
|
|
|
nsresult NS_NewScriptGlobalObject(PRBool aIsChrome,
|
|
|
|
nsIScriptGlobalObject **aResult);
|
|
|
|
|
1998-07-24 05:05:42 +00:00
|
|
|
#endif /* nsGlobalWindow_h___ */
|