2001-04-27 17:03:17 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
1999-11-12 10:28:25 +03: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/
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* The Original Code is the Mozilla browser.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
|
|
|
* Communications, Inc. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1999, Mozilla. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Travis Bogard <travis@netscape.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsDocShell_h__
|
|
|
|
#define nsDocShell_h__
|
|
|
|
|
|
|
|
#include "nsIPresShell.h"
|
|
|
|
#include "nsIDOMNode.h"
|
|
|
|
#include "nsIDOMNodeList.h"
|
|
|
|
#include "nsIViewManager.h"
|
|
|
|
#include "nsIScrollableView.h"
|
|
|
|
#include "nsIContentViewer.h"
|
|
|
|
#include "nsIPref.h"
|
1999-12-12 13:15:26 +03:00
|
|
|
#include "nsVoidArray.h"
|
2001-07-16 06:40:48 +04:00
|
|
|
#include "nsIScriptContext.h"
|
2002-09-07 09:38:16 +04:00
|
|
|
#include "nsITimer.h"
|
1999-11-12 10:28:25 +03:00
|
|
|
|
|
|
|
#include "nsCDocShell.h"
|
1999-12-12 13:15:26 +03:00
|
|
|
#include "nsIDocShellTreeOwner.h"
|
1999-11-12 10:28:25 +03:00
|
|
|
#include "nsIContentViewerContainer.h"
|
2000-03-08 06:58:33 +03:00
|
|
|
#include "nsIDeviceContext.h"
|
1999-11-12 10:28:25 +03:00
|
|
|
|
|
|
|
#include "nsIDocumentLoader.h"
|
2001-10-27 06:52:39 +04:00
|
|
|
#include "nsIURILoader.h"
|
2002-02-02 08:13:56 +03:00
|
|
|
#include "nsIEditorDocShell.h"
|
1999-11-12 10:28:25 +03:00
|
|
|
|
2000-05-28 13:25:55 +04:00
|
|
|
#include "nsWeakReference.h"
|
2000-03-29 14:29:58 +04:00
|
|
|
|
|
|
|
// Local Includes
|
|
|
|
#include "nsDSURIContentListener.h"
|
2002-02-02 08:13:56 +03:00
|
|
|
#include "nsDocShellEditorData.h"
|
2000-03-29 14:29:58 +04:00
|
|
|
|
2000-04-16 12:39:15 +04:00
|
|
|
// Helper Classes
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsPoint.h" // mCurrent/mDefaultScrollbarPreferences
|
|
|
|
#include "nsString.h"
|
|
|
|
|
2001-02-15 22:10:16 +03:00
|
|
|
// Threshold value in ms for META refresh based redirects
|
|
|
|
#define REFRESH_REDIRECT_TIMER 15000
|
2000-06-22 09:36:13 +04:00
|
|
|
|
2000-02-17 05:03:02 +03:00
|
|
|
// Interfaces Needed
|
2000-04-12 04:07:04 +04:00
|
|
|
#include "nsIDocumentCharsetInfo.h"
|
2001-05-17 06:12:51 +04:00
|
|
|
#include "nsIDocCharset.h"
|
2004-02-11 05:10:04 +03:00
|
|
|
#include "nsIGlobalHistory2.h"
|
2000-04-16 12:39:15 +04:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2001-09-06 01:28:38 +04:00
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
2000-04-22 03:31:40 +04:00
|
|
|
#include "nsIPrompt.h"
|
2000-04-13 07:11:44 +04:00
|
|
|
#include "nsIRefreshURI.h"
|
2000-04-16 12:39:15 +04:00
|
|
|
#include "nsIScriptGlobalObject.h"
|
|
|
|
#include "nsIScriptGlobalObjectOwner.h"
|
2000-02-17 05:03:02 +03:00
|
|
|
#include "nsISHistory.h"
|
2003-05-30 04:21:01 +04:00
|
|
|
#include "nsILayoutHistoryState.h"
|
2000-04-13 07:11:44 +04:00
|
|
|
#include "nsIStringBundle.h"
|
2000-04-16 12:39:15 +04:00
|
|
|
#include "nsISupportsArray.h"
|
2000-02-14 09:40:28 +03:00
|
|
|
#include "nsIWebNavigation.h"
|
2002-04-02 01:22:27 +04:00
|
|
|
#include "nsIWebPageDescriptor.h"
|
2000-03-26 08:52:06 +04:00
|
|
|
#include "nsIWebProgressListener.h"
|
2000-06-21 10:40:08 +04:00
|
|
|
#include "nsISHContainer.h"
|
2000-06-22 11:22:23 +04:00
|
|
|
#include "nsIDocShellLoadInfo.h"
|
2000-07-06 03:10:29 +04:00
|
|
|
#include "nsIDocShellHistory.h"
|
2000-11-09 00:00:37 +03:00
|
|
|
#include "nsIURIFixup.h"
|
2001-04-28 01:11:03 +04:00
|
|
|
#include "nsIWebBrowserFind.h"
|
2001-11-28 02:14:15 +03:00
|
|
|
#include "nsIHttpChannel.h"
|
2003-04-17 17:16:05 +04:00
|
|
|
#include "nsDocShellTransferableHooks.h"
|
2000-02-14 09:40:28 +03:00
|
|
|
|
2002-04-05 02:10:10 +04:00
|
|
|
|
2000-09-20 16:23:53 +04:00
|
|
|
#define MAKE_LOAD_TYPE(type, flags) ((type) | ((flags) << 16))
|
|
|
|
|
2002-04-05 02:10:10 +04:00
|
|
|
/* load commands were moved to nsIDocShell.h */
|
2000-09-20 16:23:53 +04:00
|
|
|
|
2003-05-26 16:14:17 +04:00
|
|
|
/* load types are legal combinations of load commands and flags
|
|
|
|
*
|
|
|
|
* NOTE:
|
|
|
|
* Remember to update the IsValidLoadType function below if you change this
|
|
|
|
* enum to ensure bad flag combinations will be rejected.
|
|
|
|
*/
|
2000-09-20 16:23:53 +04:00
|
|
|
enum LoadType {
|
2002-04-05 02:10:10 +04:00
|
|
|
LOAD_NORMAL = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_NONE),
|
|
|
|
LOAD_NORMAL_REPLACE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY),
|
|
|
|
LOAD_HISTORY = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_HISTORY, nsIWebNavigation::LOAD_FLAGS_NONE),
|
|
|
|
LOAD_RELOAD_NORMAL = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_NONE),
|
|
|
|
LOAD_RELOAD_BYPASS_CACHE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE),
|
|
|
|
LOAD_RELOAD_BYPASS_PROXY = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY),
|
|
|
|
LOAD_RELOAD_BYPASS_PROXY_AND_CACHE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE | nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY),
|
|
|
|
LOAD_LINK = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_IS_LINK),
|
|
|
|
LOAD_REFRESH = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_IS_REFRESH),
|
|
|
|
LOAD_RELOAD_CHARSET_CHANGE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE),
|
|
|
|
LOAD_BYPASS_HISTORY = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY)
|
2003-05-26 16:14:17 +04:00
|
|
|
// NOTE: Adding a new value? Remember to update IsValidLoadType!
|
2000-09-20 16:23:53 +04:00
|
|
|
};
|
2003-05-26 16:14:17 +04:00
|
|
|
static inline PRBool IsValidLoadType(PRUint32 aLoadType)
|
|
|
|
{
|
|
|
|
switch (aLoadType)
|
|
|
|
{
|
|
|
|
case LOAD_NORMAL:
|
|
|
|
case LOAD_NORMAL_REPLACE:
|
|
|
|
case LOAD_HISTORY:
|
|
|
|
case LOAD_RELOAD_NORMAL:
|
|
|
|
case LOAD_RELOAD_BYPASS_CACHE:
|
|
|
|
case LOAD_RELOAD_BYPASS_PROXY:
|
|
|
|
case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE:
|
|
|
|
case LOAD_LINK:
|
|
|
|
case LOAD_REFRESH:
|
|
|
|
case LOAD_RELOAD_CHARSET_CHANGE:
|
|
|
|
case LOAD_BYPASS_HISTORY:
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
2000-09-20 16:23:53 +04:00
|
|
|
|
2001-04-17 00:17:36 +04:00
|
|
|
/* internally used ViewMode types */
|
|
|
|
enum ViewMode {
|
2001-04-27 17:03:17 +04:00
|
|
|
viewNormal = 0x0,
|
|
|
|
viewSource = 0x1
|
2001-04-17 00:17:36 +04:00
|
|
|
};
|
2000-09-20 16:23:53 +04:00
|
|
|
|
2000-04-13 07:11:44 +04:00
|
|
|
//*****************************************************************************
|
|
|
|
//*** nsRefreshTimer
|
|
|
|
//*****************************************************************************
|
|
|
|
|
|
|
|
class nsRefreshTimer : public nsITimerCallback
|
|
|
|
{
|
|
|
|
public:
|
2001-04-27 17:03:17 +04:00
|
|
|
nsRefreshTimer();
|
2000-04-13 07:11:44 +04:00
|
|
|
|
2001-04-27 17:03:17 +04:00
|
|
|
NS_DECL_ISUPPORTS
|
2002-09-07 09:38:16 +04:00
|
|
|
NS_DECL_NSITIMERCALLBACK
|
|
|
|
|
2002-02-09 01:46:09 +03:00
|
|
|
PRInt32 GetDelay() { return mDelay ;}
|
2000-04-13 07:11:44 +04:00
|
|
|
|
2001-04-27 17:03:17 +04:00
|
|
|
nsCOMPtr<nsIDocShell> mDocShell;
|
|
|
|
nsCOMPtr<nsIURI> mURI;
|
|
|
|
PRInt32 mDelay;
|
2004-02-11 09:09:51 +03:00
|
|
|
PRPackedBool mRepeat;
|
|
|
|
PRPackedBool mMetaRefresh;
|
2002-02-09 01:46:09 +03:00
|
|
|
|
2000-04-13 07:11:44 +04:00
|
|
|
protected:
|
2001-04-27 17:03:17 +04:00
|
|
|
virtual ~nsRefreshTimer();
|
2000-04-13 07:11:44 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//*** nsDocShell
|
|
|
|
//*****************************************************************************
|
|
|
|
|
1999-12-03 13:29:08 +03:00
|
|
|
class nsDocShell : public nsIDocShell,
|
|
|
|
public nsIDocShellTreeItem,
|
1999-12-03 12:24:22 +03:00
|
|
|
public nsIDocShellTreeNode,
|
2000-07-06 03:10:29 +04:00
|
|
|
public nsIDocShellHistory,
|
2000-02-14 09:40:28 +03:00
|
|
|
public nsIWebNavigation,
|
1999-11-19 10:35:27 +03:00
|
|
|
public nsIBaseWindow,
|
|
|
|
public nsIScrollable,
|
|
|
|
public nsITextScroll,
|
2001-05-17 06:12:51 +04:00
|
|
|
public nsIDocCharset,
|
1999-11-23 13:15:10 +03:00
|
|
|
public nsIContentViewerContainer,
|
1999-11-30 04:06:59 +03:00
|
|
|
public nsIInterfaceRequestor,
|
2000-04-13 07:11:44 +04:00
|
|
|
public nsIScriptGlobalObjectOwner,
|
2000-05-28 13:25:55 +04:00
|
|
|
public nsIRefreshURI,
|
2000-06-20 11:59:45 +04:00
|
|
|
public nsIWebProgressListener,
|
2002-02-02 08:13:56 +03:00
|
|
|
public nsIEditorDocShell,
|
2002-04-02 01:22:27 +04:00
|
|
|
public nsIWebPageDescriptor,
|
2000-05-28 13:25:55 +04:00
|
|
|
public nsSupportsWeakReference
|
1999-11-12 10:28:25 +03:00
|
|
|
{
|
|
|
|
friend class nsDSURIContentListener;
|
|
|
|
|
|
|
|
public:
|
2001-04-27 17:03:17 +04:00
|
|
|
// Object Management
|
|
|
|
nsDocShell();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
NS_DECL_NSIDOCSHELL
|
|
|
|
NS_DECL_NSIDOCSHELLTREEITEM
|
|
|
|
NS_DECL_NSIDOCSHELLTREENODE
|
|
|
|
NS_DECL_NSIDOCSHELLHISTORY
|
|
|
|
NS_DECL_NSIWEBNAVIGATION
|
|
|
|
NS_DECL_NSIBASEWINDOW
|
|
|
|
NS_DECL_NSISCROLLABLE
|
|
|
|
NS_DECL_NSITEXTSCROLL
|
2001-05-17 06:12:51 +04:00
|
|
|
NS_DECL_NSIDOCCHARSET
|
2001-04-27 17:03:17 +04:00
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
NS_DECL_NSISCRIPTGLOBALOBJECTOWNER
|
|
|
|
NS_DECL_NSIWEBPROGRESSLISTENER
|
|
|
|
NS_DECL_NSIREFRESHURI
|
|
|
|
NS_DECL_NSICONTENTVIEWERCONTAINER
|
2002-02-02 08:13:56 +03:00
|
|
|
NS_DECL_NSIEDITORDOCSHELL
|
2002-04-02 01:22:27 +04:00
|
|
|
NS_DECL_NSIWEBPAGEDESCRIPTOR
|
2001-04-27 17:03:17 +04:00
|
|
|
|
|
|
|
nsresult SetLoadCookie(nsISupports * aCookie);
|
|
|
|
nsresult GetLoadCookie(nsISupports ** aResult);
|
2001-12-01 01:35:33 +03:00
|
|
|
nsDocShellInfoLoadType ConvertLoadTypeToDocShellLoadInfo(PRUint32 aLoadType);
|
2001-04-27 17:03:17 +04:00
|
|
|
PRUint32 ConvertDocShellLoadInfoToLoadType(nsDocShellInfoLoadType aDocShellLoadType);
|
2000-06-20 11:59:45 +04:00
|
|
|
|
1999-11-12 10:28:25 +03:00
|
|
|
protected:
|
2001-04-27 17:03:17 +04:00
|
|
|
// Object Management
|
|
|
|
virtual ~nsDocShell();
|
|
|
|
NS_IMETHOD DestroyChildren();
|
|
|
|
|
|
|
|
// Content Viewer Management
|
|
|
|
NS_IMETHOD EnsureContentViewer();
|
|
|
|
NS_IMETHOD EnsureDeviceContext();
|
|
|
|
NS_IMETHOD CreateAboutBlankContentViewer();
|
|
|
|
NS_IMETHOD CreateContentViewer(const char * aContentType,
|
|
|
|
nsIRequest * request, nsIStreamListener ** aContentHandler);
|
|
|
|
NS_IMETHOD NewContentViewerObj(const char * aContentType,
|
|
|
|
nsIRequest * request, nsILoadGroup * aLoadGroup,
|
|
|
|
nsIStreamListener ** aContentHandler, nsIContentViewer ** aViewer);
|
|
|
|
NS_IMETHOD SetupNewViewer(nsIContentViewer * aNewViewer);
|
|
|
|
|
2001-08-22 01:18:45 +04:00
|
|
|
NS_IMETHOD GetEldestPresContext(nsIPresContext** aPresContext);
|
2001-04-27 17:03:17 +04:00
|
|
|
NS_IMETHOD GetCurrentDocumentOwner(nsISupports ** aOwner);
|
2001-05-14 06:16:27 +04:00
|
|
|
virtual nsresult DoURILoad(nsIURI * aURI,
|
|
|
|
nsIURI * aReferrer,
|
|
|
|
nsISupports * aOwner,
|
2003-10-04 02:11:47 +04:00
|
|
|
const char * aTypeHint,
|
2001-05-14 06:16:27 +04:00
|
|
|
nsIInputStream * aPostData,
|
2002-03-02 04:26:49 +03:00
|
|
|
nsIInputStream * aHeadersData,
|
2002-03-13 09:08:56 +03:00
|
|
|
PRBool firstParty,
|
|
|
|
nsIDocShell ** aDocShell,
|
|
|
|
nsIRequest ** aRequest);
|
2001-04-27 17:03:17 +04:00
|
|
|
NS_IMETHOD AddHeadersToChannel(nsIInputStream * aHeadersData,
|
|
|
|
nsIChannel * aChannel);
|
2001-05-14 06:16:27 +04:00
|
|
|
virtual nsresult DoChannelLoad(nsIChannel * aChannel,
|
|
|
|
nsIURILoader * aURILoader);
|
2002-04-05 02:10:10 +04:00
|
|
|
NS_IMETHOD ScrollIfAnchor(nsIURI * aURI, PRBool * aWasAnchor, PRUint32 aLoadType, nscoord *cx, nscoord *cy);
|
2001-04-27 17:03:17 +04:00
|
|
|
NS_IMETHOD OnLoadingSite(nsIChannel * aChannel);
|
|
|
|
|
|
|
|
NS_IMETHOD OnNewURI(nsIURI * aURI, nsIChannel * aChannel, PRUint32 aLoadType);
|
|
|
|
|
|
|
|
virtual void SetReferrerURI(nsIURI * aURI);
|
|
|
|
|
|
|
|
// Session History
|
|
|
|
virtual PRBool ShouldAddToSessionHistory(nsIURI * aURI);
|
|
|
|
virtual nsresult AddToSessionHistory(nsIURI * aURI, nsIChannel * aChannel,
|
|
|
|
nsISHEntry ** aNewEntry);
|
|
|
|
|
|
|
|
NS_IMETHOD LoadHistoryEntry(nsISHEntry * aEntry, PRUint32 aLoadType);
|
|
|
|
NS_IMETHOD PersistLayoutHistoryState();
|
|
|
|
NS_IMETHOD CloneAndReplace(nsISHEntry * srcEntry, PRUint32 aCloneID,
|
|
|
|
nsISHEntry * areplaceEntry, nsISHEntry ** destEntry);
|
2001-11-20 23:14:02 +03:00
|
|
|
nsresult GetRootSessionHistory(nsISHistory ** aReturn);
|
2001-11-28 02:14:15 +03:00
|
|
|
nsresult GetHttpChannel(nsIChannel * aChannel, nsIHttpChannel ** aReturn);
|
2002-05-10 00:32:35 +04:00
|
|
|
PRBool ShouldDiscardLayoutState(nsIHttpChannel * aChannel);
|
2001-04-27 17:03:17 +04:00
|
|
|
|
|
|
|
// Global History
|
2004-02-11 05:10:04 +03:00
|
|
|
nsresult AddToGlobalHistory(nsIURI * aURI, PRBool aRedirect);
|
2001-04-27 17:03:17 +04:00
|
|
|
|
|
|
|
// Helper Routines
|
|
|
|
NS_IMETHOD GetPromptAndStringBundle(nsIPrompt ** aPrompt,
|
|
|
|
nsIStringBundle ** aStringBundle);
|
|
|
|
NS_IMETHOD GetChildOffset(nsIDOMNode * aChild, nsIDOMNode * aParent,
|
|
|
|
PRInt32 * aOffset);
|
|
|
|
NS_IMETHOD GetRootScrollableView(nsIScrollableView ** aOutScrollView);
|
|
|
|
NS_IMETHOD EnsureContentListener();
|
|
|
|
NS_IMETHOD EnsureScriptEnvironment();
|
2002-02-02 08:13:56 +03:00
|
|
|
NS_IMETHOD EnsureEditorData();
|
2003-04-17 17:16:05 +04:00
|
|
|
nsresult EnsureTransferableHookData();
|
2001-04-28 01:11:03 +04:00
|
|
|
NS_IMETHOD EnsureFind();
|
2002-02-09 01:46:09 +03:00
|
|
|
NS_IMETHOD RefreshURIFromQueue();
|
2002-07-12 00:59:03 +04:00
|
|
|
NS_IMETHOD DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aURL);
|
|
|
|
NS_IMETHOD LoadErrorPage(nsIURI *aURI, const PRUnichar *aURL, const PRUnichar *aPage, const PRUnichar *aDescription);
|
2002-10-08 17:17:56 +04:00
|
|
|
PRBool IsPrintingOrPP(PRBool aDisplayErrorDialog = PR_TRUE);
|
2001-04-27 17:03:17 +04:00
|
|
|
|
2002-09-20 01:59:34 +04:00
|
|
|
nsresult SetBaseUrlForWyciwyg(nsIContentViewer * aContentViewer);
|
|
|
|
|
2001-09-08 02:06:08 +04:00
|
|
|
static inline PRUint32
|
|
|
|
PRTimeToSeconds(PRTime t_usec)
|
|
|
|
{
|
|
|
|
PRTime usec_per_sec;
|
|
|
|
PRUint32 t_sec;
|
|
|
|
LL_I2L(usec_per_sec, PR_USEC_PER_SEC);
|
|
|
|
LL_DIV(t_usec, t_usec, usec_per_sec);
|
|
|
|
LL_L2I(t_sec, t_usec);
|
|
|
|
return t_sec;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-14 06:16:27 +04:00
|
|
|
|
|
|
|
virtual nsresult FindTarget(const PRUnichar *aTargetName,
|
|
|
|
PRBool *aIsNewWindow,
|
|
|
|
nsIDocShell **aResult);
|
|
|
|
|
2001-04-27 17:03:17 +04:00
|
|
|
PRBool IsFrame();
|
|
|
|
|
|
|
|
//
|
|
|
|
// Helper method that is called when a new document (including any
|
|
|
|
// sub-documents - ie. frames) has been completely loaded.
|
|
|
|
//
|
2001-07-18 00:17:38 +04:00
|
|
|
virtual nsresult EndPageLoad(nsIWebProgress * aProgress,
|
|
|
|
nsIChannel * aChannel,
|
|
|
|
nsresult aResult);
|
1999-11-12 10:28:25 +03:00
|
|
|
protected:
|
2001-04-27 17:03:17 +04:00
|
|
|
nsString mName;
|
|
|
|
nsString mTitle;
|
|
|
|
nsVoidArray mChildren;
|
|
|
|
nsCOMPtr<nsISupportsArray> mRefreshURIList;
|
|
|
|
nsDSURIContentListener * mContentListener;
|
2002-01-08 16:01:38 +03:00
|
|
|
nsRect mBounds; // Dimensions of the docshell
|
2001-04-27 17:03:17 +04:00
|
|
|
nsCOMPtr<nsIContentViewer> mContentViewer;
|
|
|
|
nsCOMPtr<nsIDocumentCharsetInfo> mDocumentCharsetInfo;
|
|
|
|
nsCOMPtr<nsIDeviceContext> mDeviceContext;
|
|
|
|
nsCOMPtr<nsIDocumentLoader>mDocLoader;
|
|
|
|
nsCOMPtr<nsIWidget> mParentWidget;
|
|
|
|
nsCOMPtr<nsIPref> mPrefs;
|
|
|
|
nsCOMPtr<nsIURI> mCurrentURI;
|
|
|
|
nsCOMPtr<nsIURI> mReferrerURI;
|
|
|
|
nsCOMPtr<nsIScriptGlobalObject> mScriptGlobal;
|
|
|
|
nsCOMPtr<nsIScriptContext> mScriptContext;
|
|
|
|
nsCOMPtr<nsISHistory> mSessionHistory;
|
2004-02-11 05:10:04 +03:00
|
|
|
nsCOMPtr<nsIGlobalHistory2> mGlobalHistory;
|
2001-04-27 17:03:17 +04:00
|
|
|
nsCOMPtr<nsISupports> mLoadCookie; // the load cookie associated with the window context.
|
|
|
|
nsCOMPtr<nsIURIFixup> mURIFixup;
|
2001-04-28 01:11:03 +04:00
|
|
|
nsCOMPtr<nsIWebBrowserFind> mFind;
|
2001-04-27 17:03:17 +04:00
|
|
|
PRInt32 mMarginWidth;
|
|
|
|
PRInt32 mMarginHeight;
|
|
|
|
PRInt32 mItemType;
|
|
|
|
nsPoint mCurrentScrollbarPref; // this document only
|
|
|
|
nsPoint mDefaultScrollbarPref; // persistent across doc loads
|
|
|
|
PRUint32 mLoadType;
|
2001-06-26 05:19:11 +04:00
|
|
|
|
2001-04-27 17:03:17 +04:00
|
|
|
PRBool mAllowSubframes;
|
2001-06-26 05:19:11 +04:00
|
|
|
PRPackedBool mAllowPlugins;
|
|
|
|
PRPackedBool mAllowJavascript;
|
|
|
|
PRPackedBool mAllowMetaRedirects;
|
|
|
|
PRPackedBool mAllowImages;
|
|
|
|
PRPackedBool mFocusDocFirst;
|
2001-12-11 05:41:22 +03:00
|
|
|
PRPackedBool mHasFocus;
|
|
|
|
PRPackedBool mCreatingDocument; // (should be) debugging only
|
2002-07-12 00:59:03 +04:00
|
|
|
PRPackedBool mUseErrorPages;
|
2003-04-26 03:29:17 +04:00
|
|
|
PRPackedBool mAllowAuth;
|
2001-06-26 05:19:11 +04:00
|
|
|
|
2001-04-27 17:03:17 +04:00
|
|
|
PRUint32 mAppType;
|
|
|
|
PRInt32 mChildOffset; // Offset in the parent's child list.
|
|
|
|
PRUint32 mBusyFlags;
|
2001-05-23 03:52:17 +04:00
|
|
|
|
2001-04-27 17:03:17 +04:00
|
|
|
// Reference to the SHEntry for this docshell until the page is destroyed.
|
|
|
|
// Somebody give me better name
|
2001-07-03 04:00:12 +04:00
|
|
|
nsCOMPtr<nsISHEntry> mOSHE;
|
2001-04-27 17:03:17 +04:00
|
|
|
// Reference to the SHEntry for this docshell until the page is loaded
|
|
|
|
// Somebody give me better name
|
2001-07-03 04:00:12 +04:00
|
|
|
nsCOMPtr<nsISHEntry> mLSHE;
|
2001-04-27 17:03:17 +04:00
|
|
|
|
2004-02-11 09:09:51 +03:00
|
|
|
PRPackedBool mFiredUnloadEvent;
|
2001-07-18 00:17:38 +04:00
|
|
|
|
2001-04-27 17:03:17 +04:00
|
|
|
// this flag is for bug #21358. a docshell may load many urls
|
|
|
|
// which don't result in new documents being created (i.e. a new content viewer)
|
|
|
|
// we want to make sure we don't call a on load event more than once for a given
|
|
|
|
// content viewer.
|
2004-02-11 09:09:51 +03:00
|
|
|
PRPackedBool mEODForCurrentDocument;
|
|
|
|
PRPackedBool mURIResultedInDocument;
|
|
|
|
|
|
|
|
PRPackedBool mIsBeingDestroyed;
|
2001-04-27 17:03:17 +04:00
|
|
|
|
|
|
|
// used to keep track of whether user click links should be handle by us
|
|
|
|
// or immediately kicked out to an external application. mscott: eventually
|
|
|
|
// i'm going to try to fold this up into the uriloader where it belongs but i haven't
|
|
|
|
// figured out how to do that yet.
|
2004-02-11 09:09:51 +03:00
|
|
|
PRPackedBool mUseExternalProtocolHandler;
|
2001-04-27 17:03:17 +04:00
|
|
|
|
|
|
|
// Disallow popping up new windows with target=
|
2004-02-11 09:09:51 +03:00
|
|
|
PRPackedBool mDisallowPopupWindows;
|
2001-04-27 17:03:17 +04:00
|
|
|
|
2001-05-14 06:16:27 +04:00
|
|
|
// Validate window targets to prevent frameset spoofing
|
2004-02-11 09:09:51 +03:00
|
|
|
PRPackedBool mValidateOrigin;
|
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 20:46:42 +04:00
|
|
|
|
2003-03-13 22:58:23 +03:00
|
|
|
PRPackedBool mIsExecutingOnLoadHandler;
|
|
|
|
|
2004-02-11 09:09:51 +03:00
|
|
|
// Indicates that a DocShell in this "docshell tree" is printing
|
|
|
|
PRPackedBool mIsPrintingOrPP;
|
|
|
|
|
2002-02-02 08:13:56 +03:00
|
|
|
// Editor stuff
|
|
|
|
nsDocShellEditorData* mEditorData; // editor data, if any
|
|
|
|
|
2003-04-17 17:16:05 +04:00
|
|
|
// Transferable hooks/callbacks
|
2003-04-18 06:03:44 +04:00
|
|
|
nsCOMPtr<nsIClipboardDragDropHookList> mTransferableHookData;
|
2003-04-17 17:16:05 +04:00
|
|
|
|
2001-04-27 17:03:17 +04:00
|
|
|
// WEAK REFERENCES BELOW HERE.
|
|
|
|
// Note these are intentionally not addrefd. Doing so will create a cycle.
|
|
|
|
// For that reasons don't use nsCOMPtr.
|
|
|
|
|
|
|
|
nsIDocShellTreeItem * mParent; // Weak Reference
|
|
|
|
nsIDocShellTreeOwner * mTreeOwner; // Weak Reference
|
|
|
|
nsIChromeEventHandler * mChromeEventHandler; //Weak Reference
|
2002-02-06 10:26:26 +03:00
|
|
|
|
2002-10-08 17:17:56 +04:00
|
|
|
|
2002-02-06 17:39:42 +03:00
|
|
|
public:
|
2002-02-06 10:26:26 +03:00
|
|
|
class InterfaceRequestorProxy : public nsIInterfaceRequestor {
|
|
|
|
public:
|
|
|
|
InterfaceRequestorProxy(nsIInterfaceRequestor* p);
|
|
|
|
virtual ~InterfaceRequestorProxy();
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
|
2002-02-06 17:39:42 +03:00
|
|
|
protected:
|
2002-02-06 10:26:26 +03:00
|
|
|
InterfaceRequestorProxy() {}
|
|
|
|
nsWeakPtr mWeakPtr;
|
|
|
|
};
|
1999-11-12 10:28:25 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsDocShell_h__ */
|