2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 04:12:37 -07:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-06-01 03:00:12 -07:00
|
|
|
#include "domstubs.idl"
|
2013-02-11 17:31:43 -08:00
|
|
|
#include "nsIDocShellTreeItem.idl"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
%{ C++
|
2013-08-27 19:59:14 -07:00
|
|
|
#include "js/TypeDecls.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsPresContext;
|
|
|
|
class nsIPresShell;
|
2014-08-07 17:45:21 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class URLSearchParams;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
%}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The nsIDocShell interface.
|
|
|
|
*/
|
|
|
|
|
|
|
|
[ptr] native nsPresContext(nsPresContext);
|
|
|
|
[ptr] native nsIPresShell(nsIPresShell);
|
2014-08-07 17:45:21 -07:00
|
|
|
[ptr] native URLSearchParams(mozilla::dom::URLSearchParams);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
interface nsIURI;
|
|
|
|
interface nsIChannel;
|
|
|
|
interface nsIContentViewer;
|
|
|
|
interface nsIURIContentListener;
|
|
|
|
interface nsIDOMEventTarget;
|
|
|
|
interface nsIDocShellLoadInfo;
|
2013-02-13 14:39:30 -08:00
|
|
|
interface nsIEditor;
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsIWebNavigation;
|
|
|
|
interface nsISimpleEnumerator;
|
|
|
|
interface nsIInputStream;
|
|
|
|
interface nsIRequest;
|
|
|
|
interface nsISHEntry;
|
|
|
|
interface nsILayoutHistoryState;
|
|
|
|
interface nsISecureBrowserUI;
|
2013-05-27 03:07:01 -07:00
|
|
|
interface nsIScriptGlobalObject;
|
2009-05-20 15:27:31 -07:00
|
|
|
interface nsIDOMStorage;
|
2009-01-12 21:52:00 -08:00
|
|
|
interface nsIPrincipal;
|
2009-12-10 20:02:13 -08:00
|
|
|
interface nsIWebBrowserPrint;
|
2009-09-01 09:45:05 -07:00
|
|
|
interface nsIVariant;
|
2012-04-19 20:19:54 -07:00
|
|
|
interface nsIPrivacyTransitionObserver;
|
2013-06-01 03:00:12 -07:00
|
|
|
interface nsIReflowObserver;
|
2014-02-27 23:45:01 -08:00
|
|
|
interface nsIScrollObserver;
|
2014-06-05 19:49:43 -07:00
|
|
|
interface nsITabParent;
|
|
|
|
|
2013-09-05 23:33:28 -07:00
|
|
|
typedef unsigned long nsLoadFlags;
|
|
|
|
|
2014-11-13 13:22:24 -08:00
|
|
|
[scriptable, builtinclass, uuid(4e3de242-0b2a-4cf0-81b5-a5fe8628431c)]
|
2013-02-11 17:31:43 -08:00
|
|
|
interface nsIDocShell : nsIDocShellTreeItem
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Loads a given URI. This will give priority to loading the requested URI
|
|
|
|
* in the object implementing this interface. If it can't be loaded here
|
|
|
|
* however, the URL dispatcher will go through its normal process of content
|
|
|
|
* loading.
|
|
|
|
*
|
|
|
|
* @param uri - The URI to load.
|
|
|
|
* @param loadInfo - This is the extended load info for this load. This
|
|
|
|
* most often will be null, but if you need to do
|
|
|
|
* additional setup for this load you can get a loadInfo
|
|
|
|
* object by calling createLoadInfo. Once you have this
|
|
|
|
* object you can set the needed properties on it and
|
|
|
|
* then pass it to loadURI.
|
2008-11-25 17:48:03 -08:00
|
|
|
* @param aLoadFlags - Flags to modify load behaviour. Flags are defined in
|
|
|
|
* nsIWebNavigation. Note that using flags outside
|
|
|
|
* LOAD_FLAGS_MASK is only allowed if passing in a
|
|
|
|
* non-null loadInfo. And even some of those might not
|
|
|
|
* be allowed. Use at your own risk.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
|
|
|
[noscript]void loadURI(in nsIURI uri,
|
|
|
|
in nsIDocShellLoadInfo loadInfo,
|
|
|
|
in unsigned long aLoadFlags,
|
|
|
|
in boolean firstParty);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads a given stream. This will give priority to loading the requested
|
|
|
|
* stream in the object implementing this interface. If it can't be loaded
|
|
|
|
* here however, the URL dispatched will go through its normal process of
|
|
|
|
* content loading.
|
|
|
|
*
|
|
|
|
* @param aStream - The input stream that provides access to the data
|
|
|
|
* to be loaded. This must be a blocking, threadsafe
|
|
|
|
* stream implementation.
|
|
|
|
* @param aURI - The URI representing the stream, or null.
|
|
|
|
* @param aContentType - The type (MIME) of data being loaded (empty if unknown).
|
|
|
|
* @param aContentCharset - The charset of the data being loaded (empty if unknown).
|
|
|
|
* @param aLoadInfo - This is the extended load info for this load. This
|
|
|
|
* most often will be null, but if you need to do
|
|
|
|
* additional setup for this load you can get a
|
|
|
|
* loadInfo object by calling createLoadInfo. Once
|
|
|
|
* you have this object you can set the needed
|
|
|
|
* properties on it and then pass it to loadStream.
|
|
|
|
*/
|
|
|
|
[noscript]void loadStream(in nsIInputStream aStream,
|
|
|
|
in nsIURI aURI,
|
|
|
|
in ACString aContentType,
|
|
|
|
in ACString aContentCharset,
|
|
|
|
in nsIDocShellLoadInfo aLoadInfo);
|
|
|
|
|
|
|
|
const long INTERNAL_LOAD_FLAGS_NONE = 0x0;
|
|
|
|
const long INTERNAL_LOAD_FLAGS_INHERIT_OWNER = 0x1;
|
|
|
|
const long INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER = 0x2;
|
|
|
|
const long INTERNAL_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 0x4;
|
|
|
|
|
|
|
|
// This flag marks the first load in this object
|
|
|
|
// @see nsIWebNavigation::LOAD_FLAGS_FIRST_LOAD
|
|
|
|
const long INTERNAL_LOAD_FLAGS_FIRST_LOAD = 0x8;
|
|
|
|
|
2008-01-29 15:49:20 -08:00
|
|
|
const long INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER = 0x10;
|
2009-06-16 07:30:25 -07:00
|
|
|
const long INTERNAL_LOAD_FLAGS_FORCE_ALLOW_COOKIES = 0x20;
|
2008-01-29 15:49:20 -08:00
|
|
|
|
2013-06-28 20:13:22 -07:00
|
|
|
// Whether the load should be treated as srcdoc load, rather than a URI one.
|
|
|
|
const long INTERNAL_LOAD_FLAGS_IS_SRCDOC = 0x40;
|
|
|
|
|
2014-05-20 06:26:59 -07:00
|
|
|
const long INTERNAL_LOAD_FLAGS_NO_OPENER = 0x100;
|
2014-01-12 12:02:27 -08:00
|
|
|
|
2014-06-19 11:22:45 -07:00
|
|
|
// NB: 0x80 is available.
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
|
|
|
* Loads the given URI. This method is identical to loadURI(...) except
|
|
|
|
* that its parameter list is broken out instead of being packaged inside
|
|
|
|
* of an nsIDocShellLoadInfo object...
|
|
|
|
*
|
|
|
|
* @param aURI - The URI to load.
|
|
|
|
* @param aReferrer - Referring URI
|
|
|
|
* @param aOwner - Owner (security principal)
|
|
|
|
* @param aInheritOwner - Flag indicating whether the owner of the current
|
|
|
|
* document should be inherited if aOwner is null.
|
|
|
|
* @param aStopActiveDoc - Flag indicating whether loading the current
|
|
|
|
* document should be stopped.
|
|
|
|
* @param aWindowTarget - Window target for the load.
|
|
|
|
* @param aTypeHint - A hint as to the content-type of the resulting
|
|
|
|
* data. May be null or empty if no hint.
|
2012-12-02 12:55:52 -08:00
|
|
|
* @param aFileName - Non-null when the link should be downloaded as
|
|
|
|
the given filename.
|
2007-03-22 10:30:00 -07:00
|
|
|
* @param aPostDataStream - Post data stream (if POSTing)
|
|
|
|
* @param aHeadersStream - Stream containing "extra" request headers...
|
|
|
|
* @param aLoadFlags - Flags to modify load behaviour. Flags are defined
|
|
|
|
* in nsIWebNavigation.
|
|
|
|
* @param aSHEntry - Active Session History entry (if loading from SH)
|
2013-06-28 20:13:22 -07:00
|
|
|
* @param aSrcdoc When INTERNAL_LOAD_FLAGS_IS_SRCDOC is set, the
|
|
|
|
* contents of this parameter will be loaded instead
|
|
|
|
* of aURI.
|
2014-01-12 23:58:16 -08:00
|
|
|
* @param aSourceDocShell - The source browsing context for the navigation.
|
2014-02-06 06:46:29 -08:00
|
|
|
* @param aBaseURI - The base URI to be used for the load. Set in
|
|
|
|
* srcdoc loads as it cannot otherwise be inferred
|
|
|
|
* in certain situations such as view-source.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
|
|
|
[noscript]void internalLoad(in nsIURI aURI,
|
|
|
|
in nsIURI aReferrer,
|
|
|
|
in nsISupports aOwner,
|
2012-08-22 08:56:38 -07:00
|
|
|
in uint32_t aFlags,
|
2007-03-22 10:30:00 -07:00
|
|
|
in wstring aWindowTarget,
|
|
|
|
in string aTypeHint,
|
2012-12-02 12:55:52 -08:00
|
|
|
in AString aFileName,
|
2007-03-22 10:30:00 -07:00
|
|
|
in nsIInputStream aPostDataStream,
|
|
|
|
in nsIInputStream aHeadersStream,
|
|
|
|
in unsigned long aLoadFlags,
|
|
|
|
in nsISHEntry aSHEntry,
|
|
|
|
in boolean firstParty,
|
2013-06-28 20:13:22 -07:00
|
|
|
in AString aSrcdoc,
|
2014-01-12 23:58:16 -08:00
|
|
|
in nsIDocShell aSourceDocShell,
|
2014-02-06 06:46:29 -08:00
|
|
|
in nsIURI aBaseURI,
|
2007-03-22 10:30:00 -07:00
|
|
|
out nsIDocShell aDocShell,
|
2010-09-30 16:55:11 -07:00
|
|
|
out nsIRequest aRequest);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-09-01 09:45:05 -07:00
|
|
|
/**
|
|
|
|
* Do either a history.pushState() or history.replaceState() operation,
|
|
|
|
* depending on the value of aReplace.
|
|
|
|
*/
|
2011-03-03 03:55:55 -08:00
|
|
|
[implicit_jscontext]
|
2013-08-09 23:47:59 -07:00
|
|
|
void addState(in jsval aData, in DOMString aTitle,
|
2009-09-01 09:45:05 -07:00
|
|
|
in DOMString aURL, in boolean aReplace);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
|
|
|
* Creates a DocShellLoadInfo object that you can manipulate and then pass
|
|
|
|
* to loadURI.
|
|
|
|
*/
|
|
|
|
void createLoadInfo(out nsIDocShellLoadInfo loadInfo);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reset state to a new content model within the current document and the document
|
|
|
|
* viewer. Called by the document before initiating an out of band document.write().
|
|
|
|
*/
|
|
|
|
void prepareForNewContentModel();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* For editors and suchlike who wish to change the URI associated with the
|
|
|
|
* document. Note if you want to get the current URI, use the read-only
|
|
|
|
* property on nsIWebNavigation.
|
|
|
|
*/
|
|
|
|
void setCurrentURI(in nsIURI aURI);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify the associated content viewer and all child docshells that they are
|
|
|
|
* about to be hidden. If |isUnload| is true, then the document is being
|
|
|
|
* unloaded as well.
|
2007-06-14 11:18:05 -07:00
|
|
|
*
|
|
|
|
* @param isUnload if true, fire the unload event in addition to the pagehide
|
|
|
|
* event.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
|
|
|
[noscript] void firePageHideNotification(in boolean isUnload);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Presentation context for the currently loaded document. This may be null.
|
|
|
|
*/
|
|
|
|
[noscript] readonly attribute nsPresContext presContext;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Presentation shell for the currently loaded document. This may be null.
|
|
|
|
*/
|
2012-12-28 17:56:42 -08:00
|
|
|
[noscript,notxpcom] nsIPresShell GetPresShell();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Presentation shell for the oldest document, if this docshell is
|
|
|
|
* currently transitioning between documents.
|
|
|
|
*/
|
|
|
|
[noscript] readonly attribute nsIPresShell eldestPresShell;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Content Viewer that is currently loaded for this DocShell. This may
|
|
|
|
* change as the underlying content changes.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIContentViewer contentViewer;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This attribute allows chrome to tie in to handle DOM events that may
|
|
|
|
* be of interest to chrome.
|
|
|
|
*/
|
|
|
|
attribute nsIDOMEventTarget chromeEventHandler;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether to allow plugin execution
|
|
|
|
*/
|
|
|
|
attribute boolean allowPlugins;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether to allow Javascript execution
|
|
|
|
*/
|
|
|
|
attribute boolean allowJavascript;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attribute stating if refresh based redirects can be allowed
|
|
|
|
*/
|
|
|
|
attribute boolean allowMetaRedirects;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attribute stating if it should allow subframes (framesets/iframes) or not
|
|
|
|
*/
|
|
|
|
attribute boolean allowSubframes;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attribute stating whether or not images should be loaded.
|
|
|
|
*/
|
|
|
|
attribute boolean allowImages;
|
|
|
|
|
2013-03-29 14:52:59 -07:00
|
|
|
/**
|
|
|
|
* Attribute stating whether or not media (audio/video) should be loaded.
|
|
|
|
*/
|
|
|
|
[infallible] attribute boolean allowMedia;
|
|
|
|
|
2009-05-17 07:22:54 -07:00
|
|
|
/**
|
|
|
|
* Attribute that determines whether DNS prefetch is allowed for this subtree
|
|
|
|
* of the docshell tree. Defaults to true. Setting this will make it take
|
|
|
|
* effect starting with the next document loaded in the docshell.
|
|
|
|
*/
|
|
|
|
attribute boolean allowDNSPrefetch;
|
|
|
|
|
2011-06-25 04:42:41 -07:00
|
|
|
/**
|
|
|
|
* Attribute that determines whether window control (move/resize) is allowed.
|
|
|
|
*/
|
|
|
|
attribute boolean allowWindowControl;
|
|
|
|
|
2013-08-24 01:10:50 -07:00
|
|
|
/**
|
|
|
|
* True if the docshell allows its content to be handled by a content listener
|
|
|
|
* other than the docshell itself, including the external helper app service,
|
|
|
|
* and false otherwise. Defaults to true.
|
|
|
|
*/
|
|
|
|
[infallible] attribute boolean allowContentRetargeting;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
|
|
|
* Get an enumerator over this docShell and its children.
|
|
|
|
*
|
|
|
|
* @param aItemType - Only include docShells of this type, or if typeAll,
|
|
|
|
* include all child shells.
|
|
|
|
* Uses types from nsIDocShellTreeItem.
|
|
|
|
* @param aDirection - Whether to enumerate forwards or backwards.
|
|
|
|
*/
|
|
|
|
|
|
|
|
const long ENUMERATE_FORWARDS = 0;
|
|
|
|
const long ENUMERATE_BACKWARDS = 1;
|
|
|
|
|
|
|
|
nsISimpleEnumerator getDocShellEnumerator(in long aItemType,
|
|
|
|
in long aDirection);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of application that created this window
|
|
|
|
*/
|
|
|
|
const unsigned long APP_TYPE_UNKNOWN = 0;
|
|
|
|
const unsigned long APP_TYPE_MAIL = 1;
|
|
|
|
const unsigned long APP_TYPE_EDITOR = 2;
|
|
|
|
|
|
|
|
attribute unsigned long appType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* certain dochshells (like the message pane)
|
|
|
|
* should not throw up auth dialogs
|
|
|
|
* because it can act as a password trojan
|
|
|
|
*/
|
|
|
|
attribute boolean allowAuth;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set/Get the document scale factor. When setting this attribute, a
|
|
|
|
* NS_ERROR_NOT_IMPLEMENTED error may be returned by implementations
|
|
|
|
* not supporting zoom. Implementations not supporting zoom should return
|
|
|
|
* 1.0 all the time for the Get operation. 1.0 by the way is the default
|
|
|
|
* of zoom. This means 100% of normal scaling or in other words normal size
|
|
|
|
* no zoom.
|
|
|
|
*/
|
|
|
|
attribute float zoom;
|
|
|
|
|
|
|
|
/*
|
2009-05-07 12:21:53 -07:00
|
|
|
* The size, in CSS pixels, of the horizontal margins for the <body> of an
|
|
|
|
* HTML document in this docshel; used to implement the marginwidth attribute
|
|
|
|
* on HTML <frame>/<iframe> elements. A value smaller than zero indicates
|
|
|
|
* that the attribute was not set.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
|
|
|
attribute long marginWidth;
|
|
|
|
|
|
|
|
/*
|
2009-05-07 12:21:53 -07:00
|
|
|
* The size, in CSS pixels, of the vertical margins for the <body> of an HTML
|
|
|
|
* document in this docshel; used to implement the marginheight attribute on
|
|
|
|
* HTML <frame>/<iframe> elements. A value smaller than zero indicates that
|
|
|
|
* the attribute was not set.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
|
|
|
attribute long marginHeight;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Tells the docshell to offer focus to its tree owner.
|
|
|
|
* This is currently only necessary for embedding chrome.
|
|
|
|
*/
|
|
|
|
void tabToTreeOwner(in boolean forward,
|
|
|
|
out boolean tookFocus);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Current busy state for DocShell
|
|
|
|
*/
|
|
|
|
const unsigned long BUSY_FLAGS_NONE = 0;
|
|
|
|
const unsigned long BUSY_FLAGS_BUSY = 1;
|
|
|
|
const unsigned long BUSY_FLAGS_BEFORE_PAGE_LOAD = 2;
|
|
|
|
const unsigned long BUSY_FLAGS_PAGE_LOADING = 4;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Load commands for the document
|
|
|
|
*/
|
2009-09-01 09:45:05 -07:00
|
|
|
const unsigned long LOAD_CMD_NORMAL = 0x1; // Normal load
|
|
|
|
const unsigned long LOAD_CMD_RELOAD = 0x2; // Reload
|
|
|
|
const unsigned long LOAD_CMD_HISTORY = 0x4; // Load from history
|
|
|
|
const unsigned long LOAD_CMD_PUSHSTATE = 0x8; // History.pushState()
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
readonly attribute unsigned long busyFlags;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* attribute to access the loadtype for the document
|
|
|
|
*/
|
|
|
|
attribute unsigned long loadType;
|
|
|
|
|
2013-09-05 23:33:28 -07:00
|
|
|
/*
|
|
|
|
* Default load flags (as defined in nsIRequest) that will be set on all
|
2013-09-05 23:33:29 -07:00
|
|
|
* requests made by this docShell and propagated to all child docShells and
|
|
|
|
* to nsILoadGroup::defaultLoadFlags for the docShell's loadGroup.
|
2013-09-05 23:33:28 -07:00
|
|
|
* Default is no flags. Once set, only future requests initiated by the
|
|
|
|
* docShell are affected, so in general, these flags should be set before
|
|
|
|
* the docShell loads any content.
|
|
|
|
*/
|
|
|
|
attribute nsLoadFlags defaultLoadFlags;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/*
|
|
|
|
* returns true if the docshell is being destroyed, false otherwise
|
|
|
|
*/
|
|
|
|
boolean isBeingDestroyed();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns true if the docshell is currently executing the onLoad Handler
|
|
|
|
*/
|
|
|
|
readonly attribute boolean isExecutingOnLoadHandler;
|
|
|
|
|
|
|
|
attribute nsILayoutHistoryState layoutHistoryState;
|
|
|
|
|
|
|
|
readonly attribute boolean shouldSaveLayoutState;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The SecureBrowserUI object for this docshell. This is set by XUL
|
|
|
|
* <browser> or nsWebBrowser for their root docshell.
|
|
|
|
*/
|
|
|
|
attribute nsISecureBrowserUI securityUI;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancel the XPCOM timers for each meta-refresh URI in this docshell,
|
|
|
|
* and this docshell's children, recursively. The meta-refresh timers can be
|
|
|
|
* restarted using resumeRefreshURIs(). If the timers are already suspended,
|
|
|
|
* this has no effect.
|
|
|
|
*/
|
|
|
|
void suspendRefreshURIs();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restart the XPCOM timers for each meta-refresh URI in this docshell,
|
|
|
|
* and this docshell's children, recursively. If the timers are already
|
|
|
|
* running, this has no effect.
|
|
|
|
*/
|
|
|
|
void resumeRefreshURIs();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Begin firing WebProgressListener notifications for restoring a page
|
|
|
|
* presentation. |viewer| is the content viewer whose document we are
|
|
|
|
* starting to load. If null, it defaults to the docshell's current content
|
|
|
|
* viewer, creating one if necessary. |top| should be true for the toplevel
|
|
|
|
* docshell that is being restored; it will be set to false when this method
|
|
|
|
* is called for child docshells. This method will post an event to
|
|
|
|
* complete the simulated load after returning to the event loop.
|
|
|
|
*/
|
|
|
|
void beginRestore(in nsIContentViewer viewer, in boolean top);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Finish firing WebProgressListener notifications and DOM events for
|
|
|
|
* restoring a page presentation. This should only be called via
|
|
|
|
* beginRestore().
|
|
|
|
*/
|
|
|
|
void finishRestore();
|
|
|
|
|
|
|
|
/* Track whether we're currently restoring a document presentation. */
|
|
|
|
readonly attribute boolean restoringDocument;
|
|
|
|
|
|
|
|
/* attribute to access whether error pages are enabled */
|
|
|
|
attribute boolean useErrorPages;
|
|
|
|
|
2013-09-03 15:11:22 -07:00
|
|
|
/**
|
|
|
|
* Display a load error in a frame while keeping that frame's currentURI
|
|
|
|
* pointing correctly to the page where the error ocurred, rather than to
|
|
|
|
* the error document page. You must provide either the aURI or aURL parameter.
|
|
|
|
*
|
|
|
|
* @param aError The error code to be displayed
|
|
|
|
* @param aURI nsIURI of the page where the error happened
|
|
|
|
* @param aURL wstring of the page where the error happened
|
|
|
|
* @param aFailedChannel The channel related to this error
|
|
|
|
*/
|
|
|
|
void displayLoadError(in nsresult aError,
|
|
|
|
in nsIURI aURI,
|
|
|
|
in wstring aURL,
|
|
|
|
[optional] in nsIChannel aFailedChannel);
|
|
|
|
|
2014-06-19 13:55:55 -07:00
|
|
|
/**
|
|
|
|
* The channel that failed to load and resulted in an error page.
|
|
|
|
* May be null. Relevant only to error pages.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIChannel failedChannel;
|
2013-09-03 15:11:22 -07:00
|
|
|
|
2008-09-11 14:54:40 -07:00
|
|
|
/**
|
|
|
|
* Keeps track of the previous SHTransaction index and the current
|
|
|
|
* SHTransaction index at the time that the doc shell begins to load.
|
|
|
|
* Used for ContentViewer eviction.
|
|
|
|
*/
|
|
|
|
readonly attribute long previousTransIndex;
|
|
|
|
readonly attribute long loadedTransIndex;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notification that entries have been removed from the beginning of a
|
|
|
|
* nsSHistory which has this as its rootDocShell.
|
|
|
|
*
|
|
|
|
* @param numEntries - The number of entries removed
|
|
|
|
*/
|
|
|
|
void historyPurged(in long numEntries);
|
|
|
|
|
2009-05-20 15:27:31 -07:00
|
|
|
/*
|
2013-04-15 05:38:48 -07:00
|
|
|
* @deprecated, use nsIDocShell.QueryInterface(nsIDOMStorageManager) instead.
|
|
|
|
*
|
2009-05-20 15:27:31 -07:00
|
|
|
* Retrieves the WebApps session storage object for the supplied principal.
|
|
|
|
*
|
|
|
|
* @param principal returns a storage for this principal
|
2010-01-28 06:53:53 -08:00
|
|
|
* @param documentURI new storage will be created with reference to this
|
|
|
|
* document.documentURI that will appear in storage event
|
2009-05-20 15:27:31 -07:00
|
|
|
* @param create If true and a session storage object doesn't
|
|
|
|
* already exist, a new one will be created.
|
|
|
|
*/
|
|
|
|
nsIDOMStorage getSessionStorageForPrincipal(in nsIPrincipal principal,
|
2010-01-28 06:53:53 -08:00
|
|
|
in DOMString documentURI,
|
2009-05-20 15:27:31 -07:00
|
|
|
in boolean create);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/*
|
2013-04-15 05:38:48 -07:00
|
|
|
* @deprecated, use nsIDocShell.QueryInterface(nsIDOMStorageManager) instead.
|
|
|
|
*
|
2007-03-22 10:30:00 -07:00
|
|
|
* Add a WebApps session storage object to the docshell.
|
|
|
|
*
|
2009-05-20 15:27:31 -07:00
|
|
|
* @param principal the principal the storage object is associated with
|
2007-03-22 10:30:00 -07:00
|
|
|
* @param storage the storage object to add
|
|
|
|
*/
|
2009-05-20 15:27:31 -07:00
|
|
|
void addSessionStorage(in nsIPrincipal principal, in nsIDOMStorage storage);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the channel for the currently loaded document, if any.
|
|
|
|
* For a new document load, this will be the channel of the previous document
|
|
|
|
* until after OnLocationChange fires.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIChannel currentDocumentChannel;
|
2007-05-17 20:49:14 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the offset of this child in its container.
|
|
|
|
*/
|
|
|
|
[noscript] void setChildOffset(in unsigned long offset);
|
2007-06-14 11:18:05 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Find out whether the docshell is currently in the middle of a page
|
2009-07-13 04:55:56 -07:00
|
|
|
* transition. This is set just before the pagehide/unload events fire.
|
2007-06-14 11:18:05 -07:00
|
|
|
*/
|
|
|
|
readonly attribute boolean isInUnload;
|
2007-11-26 21:32:23 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Find out if the currently loaded document came from a suspicious channel
|
|
|
|
* (such as a JAR channel where the server-returned content type isn't a
|
|
|
|
* known JAR type).
|
|
|
|
*/
|
|
|
|
readonly attribute boolean channelIsUnsafe;
|
2008-04-23 14:36:17 -07:00
|
|
|
|
2012-12-13 14:53:06 -08:00
|
|
|
/**
|
|
|
|
* This attribute determines whether Mixed Active Content is loaded on the
|
|
|
|
* document. When it is true, mixed active content was not blocked and has
|
2013-01-30 00:04:41 -08:00
|
|
|
* loaded (or is about to load) on the page. When it is false, mixed active content
|
|
|
|
* has not loaded on the page, either because there was no mixed active content
|
|
|
|
* requests on the page or such requests were blocked by nsMixedContentBlocker.
|
2012-12-13 14:53:06 -08:00
|
|
|
* This boolean is set to true in nsMixedContentBlocker if Mixed Active Content
|
|
|
|
* is allowed (either explicitly on the page by the user or when the about:config
|
|
|
|
* setting security.mixed_content.block_active_content is set to false).
|
|
|
|
*/
|
2013-01-30 00:04:41 -08:00
|
|
|
[infallible] readonly attribute boolean hasMixedActiveContentLoaded;
|
2012-12-13 14:53:06 -08:00
|
|
|
|
2013-01-30 00:04:31 -08:00
|
|
|
/**
|
|
|
|
* This attribute determines whether a document has Mixed Active Content
|
|
|
|
* that has been blocked from loading. When it is true, there is definitely
|
|
|
|
* mixed active content on a page that has been blocked by
|
|
|
|
* nsMixedContentBlocker. When it is false, there may or may not be mixed
|
|
|
|
* active content on a page, but if there is, it will load. Note that if the
|
|
|
|
* about:config setting security.mixed_content.block_active_content is set
|
|
|
|
* false, this boolean will be false, since blocking active content has been
|
|
|
|
* disabled.
|
|
|
|
*/
|
2013-01-30 00:04:41 -08:00
|
|
|
[infallible] readonly attribute boolean hasMixedActiveContentBlocked;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This attribute determines whether Mixed Display Content is loaded on the
|
|
|
|
* document. When it is true, mixed display content was not blocked and has
|
|
|
|
* loaded (or is about to load) on the page. Similar behavior to
|
|
|
|
* hasMixedActiveContentLoaded.
|
|
|
|
*/
|
|
|
|
[infallible] readonly attribute boolean hasMixedDisplayContentLoaded;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This attribute determines whether a document has Mixed Display Content
|
|
|
|
* that has been blocked from loading. Similar behavior to
|
|
|
|
* hasMixedActiveContentBlocked.
|
|
|
|
*/
|
|
|
|
[infallible] readonly attribute boolean hasMixedDisplayContentBlocked;
|
2013-01-30 00:04:31 -08:00
|
|
|
|
2014-08-07 13:35:03 -07:00
|
|
|
/**
|
|
|
|
* This attribute determines whether a document has Tracking Content
|
|
|
|
* that has been blocked from loading.
|
|
|
|
*/
|
|
|
|
[infallible] readonly attribute boolean hasTrackingContentBlocked;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This attribute determines whether Tracking Content is loaded on the
|
|
|
|
* document. When it is true, tracking content was not blocked and has
|
|
|
|
* loaded (or is about to load) on the page.
|
|
|
|
*/
|
|
|
|
[infallible] readonly attribute boolean hasTrackingContentLoaded;
|
|
|
|
|
2008-04-23 14:36:17 -07:00
|
|
|
/**
|
|
|
|
* Disconnects this docshell's editor from its window, and stores the
|
2009-01-23 07:16:10 -08:00
|
|
|
* editor data in the open document's session history entry. This
|
|
|
|
* should be called only during page transitions.
|
2008-04-23 14:36:17 -07:00
|
|
|
*/
|
|
|
|
[noscript, notxpcom] void DetachEditorFromWindow();
|
2008-09-19 09:57:56 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If true, this browser is not visible in the traditional sense, but
|
|
|
|
* is actively being rendered to the screen (ex. painted on a canvas)
|
|
|
|
* and should be treated accordingly.
|
|
|
|
**/
|
|
|
|
attribute boolean isOffScreenBrowser;
|
2009-12-10 20:02:13 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If the current content viewer isn't initialized for print preview,
|
|
|
|
* it is replaced with one which is and to which an about:blank document
|
|
|
|
* is loaded.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIWebBrowserPrint printPreview;
|
2010-06-04 14:03:50 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether this docshell can execute scripts based on its hierarchy.
|
|
|
|
* The rule of thumb here is that we disable js if this docshell or any
|
2013-04-08 14:04:20 -07:00
|
|
|
* of its parents disallow scripting.
|
2010-06-04 14:03:50 -07:00
|
|
|
*/
|
2013-11-12 16:43:33 -08:00
|
|
|
[infallible] readonly attribute boolean canExecuteScripts;
|
2010-08-05 08:27:52 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets whether a docshell is active. An active docshell is one that is
|
|
|
|
* visible, and thus is not a good candidate for certain optimizations
|
|
|
|
* like image frame discarding. Docshells are active unless told otherwise.
|
|
|
|
*/
|
|
|
|
attribute boolean isActive;
|
2010-08-17 07:13:55 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The ID of the docshell in the session history.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long long historyID;
|
2010-10-28 15:00:31 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets whether a docshell is an app tab. An app tab docshell may behave
|
|
|
|
* differently than a non-app tab docshell in some cases, such as when
|
|
|
|
* handling link clicks. Docshells are not app tabs unless told otherwise.
|
|
|
|
*/
|
|
|
|
attribute boolean isAppTab;
|
2010-09-17 14:54:41 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new about:blank document and content viewer.
|
|
|
|
* @param aPrincipal the principal to use for the new document.
|
|
|
|
*/
|
|
|
|
void createAboutBlankContentViewer(in nsIPrincipal aPrincipal);
|
2012-01-24 01:52:04 -08:00
|
|
|
|
|
|
|
/**
|
2013-10-15 18:46:10 -07:00
|
|
|
* Upon getting, returns the canonical encoding label of the document
|
|
|
|
* currently loaded into this docshell.
|
2012-01-24 01:52:04 -08:00
|
|
|
*
|
2013-10-15 18:46:10 -07:00
|
|
|
* Upon setting, sets forcedCharset for compatibility with legacy callers.
|
2012-01-24 01:52:04 -08:00
|
|
|
*/
|
2013-10-15 18:46:10 -07:00
|
|
|
attribute ACString charset;
|
2012-01-24 01:52:05 -08:00
|
|
|
|
2013-02-28 00:44:57 -08:00
|
|
|
/**
|
|
|
|
* Called when the user chose an encoding override from the character
|
|
|
|
* encoding menu. Separate from the setter for the charset property to avoid
|
|
|
|
* extensions adding noise to the data.
|
|
|
|
*/
|
|
|
|
void gatherCharsetMenuTelemetry();
|
|
|
|
|
2012-01-24 01:52:05 -08:00
|
|
|
/**
|
2013-10-15 18:46:10 -07:00
|
|
|
* The charset forced by the user.
|
2012-01-24 01:52:05 -08:00
|
|
|
*/
|
2013-05-25 07:09:30 -07:00
|
|
|
attribute ACString forcedCharset;
|
2012-01-24 01:52:05 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* In a child docshell, this is the charset of the parent docshell
|
|
|
|
*/
|
2013-10-15 18:46:10 -07:00
|
|
|
[noscript, notxpcom, nostdcall] void setParentCharset(
|
|
|
|
in ACString parentCharset,
|
|
|
|
in int32_t parentCharsetSource,
|
|
|
|
in nsIPrincipal parentCharsetPrincipal);
|
|
|
|
[noscript, notxpcom, nostdcall] void getParentCharset(
|
|
|
|
out ACString parentCharset,
|
|
|
|
out int32_t parentCharsetSource,
|
|
|
|
out nsIPrincipal parentCharsetPrincipal);
|
2012-03-04 08:02:00 -08:00
|
|
|
|
2014-09-09 11:54:08 -07:00
|
|
|
/**
|
|
|
|
* Whether the docShell records profile timeline markers at the moment
|
|
|
|
*/
|
|
|
|
[infallible] attribute boolean recordProfileTimelineMarkers;
|
|
|
|
|
2014-10-17 16:02:42 -07:00
|
|
|
/**
|
|
|
|
* Return a DOMHighResTimeStamp representing the number of
|
|
|
|
* milliseconds from an arbitrary point in time. The reference
|
|
|
|
* point is shared by all DocShells and is also used by timestamps
|
|
|
|
* on markers.
|
|
|
|
*/
|
|
|
|
DOMHighResTimeStamp now();
|
|
|
|
|
2014-09-09 11:54:08 -07:00
|
|
|
/**
|
|
|
|
* Returns and flushes the profile timeline markers gathered by the docShell
|
|
|
|
*/
|
|
|
|
[implicit_jscontext]
|
|
|
|
jsval popProfileTimelineMarkers();
|
|
|
|
|
2012-04-19 20:19:54 -07:00
|
|
|
/**
|
|
|
|
* Add an observer to the list of parties to be notified when this docshell's
|
|
|
|
* private browsing status is changed. |obs| must support weak references.
|
|
|
|
*/
|
|
|
|
void addWeakPrivacyTransitionObserver(in nsIPrivacyTransitionObserver obs);
|
|
|
|
|
2013-06-01 03:00:12 -07:00
|
|
|
/**
|
|
|
|
* Add an observer to the list of parties to be notified when reflows are
|
|
|
|
* occurring. |obs| must support weak references.
|
|
|
|
*/
|
|
|
|
void addWeakReflowObserver(in nsIReflowObserver obs);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove an observer from the list of parties to be notified about reflows.
|
|
|
|
*/
|
|
|
|
void removeWeakReflowObserver(in nsIReflowObserver obs);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify all attached observers that a reflow has just occurred.
|
|
|
|
*
|
|
|
|
* @param interruptible if true, the reflow was interruptible.
|
|
|
|
* @param start timestamp when reflow started, in milliseconds since
|
|
|
|
* navigationStart (accurate to 1/1000 of a ms)
|
|
|
|
* @param end timestamp when reflow ended, in milliseconds since
|
|
|
|
* navigationStart (accurate to 1/1000 of a ms)
|
|
|
|
*/
|
|
|
|
[noscript] void notifyReflowObservers(in bool interruptible,
|
|
|
|
in DOMHighResTimeStamp start,
|
|
|
|
in DOMHighResTimeStamp end);
|
|
|
|
|
2014-02-27 23:45:01 -08:00
|
|
|
/**
|
|
|
|
* Add an observer to the list of parties to be notified when scroll position
|
|
|
|
* of some elements is changed.
|
|
|
|
*/
|
|
|
|
[noscript] void addWeakScrollObserver(in nsIScrollObserver obs);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an observer to the list of parties to be notified when scroll position
|
|
|
|
* of some elements is changed.
|
|
|
|
*/
|
|
|
|
[noscript] void removeWeakScrollObserver(in nsIScrollObserver obs);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify all attached observers that the scroll position of some element
|
|
|
|
* has changed.
|
|
|
|
*/
|
|
|
|
[noscript] void notifyScrollObservers();
|
|
|
|
|
2012-07-18 22:26:21 -07:00
|
|
|
/**
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
* Returns true if this docshell corresponds to an <iframe mozbrowser>.
|
|
|
|
* (<iframe mozapp mozbrowser> is not considered a browser.)
|
2012-07-18 22:26:21 -07:00
|
|
|
*/
|
2012-08-22 18:27:04 -07:00
|
|
|
[infallible] readonly attribute boolean isBrowserElement;
|
2012-07-18 22:26:21 -07:00
|
|
|
|
|
|
|
/**
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
* Returns true iff the docshell corresponds to an <iframe mozapp>.
|
2012-07-18 22:26:21 -07:00
|
|
|
*/
|
2012-08-22 18:27:04 -07:00
|
|
|
[infallible] readonly attribute boolean isApp;
|
2012-07-18 22:26:21 -07:00
|
|
|
|
|
|
|
/**
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
* Returns isBrowserElement || isApp.
|
2012-07-18 22:26:21 -07:00
|
|
|
*/
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
[infallible] readonly attribute boolean isBrowserOrApp;
|
2012-07-18 22:26:21 -07:00
|
|
|
|
|
|
|
/**
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
* Returns true if this docshell corresponds to an <iframe mozbrowser> or if
|
|
|
|
* the docshell is contained in an <iframe mozbrowser>. (<iframe mozapp
|
|
|
|
* mozbrowser> does not count as a browser.)
|
|
|
|
*
|
|
|
|
* Our notion here of "contained in" means: Walk up the docshell hierarchy in
|
|
|
|
* this process until we hit an <iframe mozapp> or <iframe mozbrowser> (or
|
|
|
|
* until the hierarchy ends). Return true iff the docshell we stopped on has
|
|
|
|
* isBrowserElement == true.
|
2012-07-18 22:26:21 -07:00
|
|
|
*/
|
2012-08-22 18:27:04 -07:00
|
|
|
[infallible] readonly attribute boolean isInBrowserElement;
|
2012-07-18 22:26:21 -07:00
|
|
|
|
|
|
|
/**
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
* Returns true if this docshell corresponds to an <iframe mozbrowser> or
|
|
|
|
* <iframe mozap>, or if this docshell is contained in an <iframe mozbrowser>
|
|
|
|
* or <iframe mozapp>.
|
2012-08-13 09:58:38 -07:00
|
|
|
*
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
* To compute this value, we walk up the docshell hierarchy. If we encounter
|
|
|
|
* a docshell with isBrowserElement or isApp before we hit the end of the
|
|
|
|
* hierarchy, we return true. Otherwise, we return false.
|
|
|
|
*/
|
|
|
|
[infallible] readonly attribute boolean isInBrowserOrApp;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicate that this docshell corresponds to an app with the given app id.
|
|
|
|
*
|
|
|
|
* You may pass NO_APP_ID or UNKNOWN_APP_ID for containingAppId. If you
|
|
|
|
* pass NO_APP_ID, then this docshell will return NO_APP_ID for appId. If
|
|
|
|
* you pass UNKNOWN_APP_ID, then this docshell will search its hiearchy for
|
|
|
|
* an app frame and use that frame's appId.
|
|
|
|
*
|
|
|
|
* You can call this method more than once, but there's no guarantee that
|
|
|
|
* other components will update their view of the world if you change a
|
|
|
|
* docshell's app id, so tread lightly.
|
|
|
|
*
|
|
|
|
* If you call this method after calling setIsBrowserInsideApp, this
|
|
|
|
* docshell will forget the fact that it was a browser.
|
|
|
|
*/
|
|
|
|
void setIsApp(in unsigned long ownAppId);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicate that this docshell corresponds to a browser inside an app with
|
|
|
|
* the given ID. As with setIsApp, you may pass NO_APP_ID or
|
|
|
|
* UNKNOWN_APP_ID.
|
|
|
|
*
|
|
|
|
* As with setIsApp, you may call this more than once, but it's kind of a
|
|
|
|
* hack, so be careful.
|
|
|
|
*/
|
|
|
|
void setIsBrowserInsideApp(in unsigned long containingAppId);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the id of the app associated with this docshell. If this docshell
|
|
|
|
* is an <iframe mozbrowser> inside an <iframe mozapp>, we return the app's
|
|
|
|
* appId.
|
2012-07-19 10:32:49 -07:00
|
|
|
*
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
* We compute this value by walking up the docshell hierarchy until we find a
|
|
|
|
* docshell on which setIsApp(x) or setIsBrowserInsideApp(x) was called
|
|
|
|
* (ignoring those docshells where x == UNKNOWN_APP_ID). We return the app
|
|
|
|
* id x.
|
2012-07-19 10:32:49 -07:00
|
|
|
*
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
* If we don't find a docshell with an associated app id in our hierarchy, we
|
|
|
|
* return NO_APP_ID. We never return UNKNOWN_APP_ID.
|
2012-11-09 17:14:40 -08:00
|
|
|
*
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
* Notice that a docshell may have an associated app even if it returns true
|
|
|
|
* for isBrowserElement!
|
2012-07-19 10:32:49 -07:00
|
|
|
*/
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 10:32:37 -08:00
|
|
|
[infallible] readonly attribute unsigned long appId;
|
2012-07-19 10:32:49 -07:00
|
|
|
|
2013-10-25 17:04:50 -07:00
|
|
|
/**
|
|
|
|
* Return the manifest URL of the app associated with this docshell.
|
|
|
|
*
|
|
|
|
* If there is no associated app in our hierarchy, we return empty string.
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString appManifestURL;
|
|
|
|
|
2012-07-19 10:32:49 -07:00
|
|
|
/**
|
2012-11-10 10:32:35 -08:00
|
|
|
* Like nsIDocShellTreeItem::GetSameTypeParent, except this ignores <iframe
|
|
|
|
* mozbrowser> and <iframe mozapp> boundaries.
|
2012-07-19 10:32:49 -07:00
|
|
|
*/
|
2012-11-10 10:32:35 -08:00
|
|
|
nsIDocShell getSameTypeParentIgnoreBrowserAndAppBoundaries();
|
2012-07-19 23:48:27 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* True iff asynchronous panning and zooming is enabled for this
|
|
|
|
* docshell.
|
|
|
|
*/
|
|
|
|
readonly attribute bool asyncPanZoomEnabled;
|
2012-07-23 12:59:37 -07:00
|
|
|
|
2012-08-20 11:34:32 -07:00
|
|
|
/**
|
|
|
|
* The sandbox flags on the docshell. These reflect the value of the sandbox
|
|
|
|
* attribute of the associated IFRAME or CSP-protectable content, if
|
|
|
|
* existent. See the HTML5 spec for more details.
|
|
|
|
* These flags on the docshell reflect the current state of the sandbox
|
|
|
|
* attribute, which is modifiable. They are only used when loading new
|
|
|
|
* content, sandbox flags are also immutably set on the document when it is
|
|
|
|
* loaded.
|
|
|
|
* The sandbox flags of a document depend on the sandbox flags on its
|
|
|
|
* docshell and of its parent document, if any.
|
|
|
|
* See nsSandboxFlags.h for the possible flags.
|
|
|
|
*/
|
|
|
|
attribute unsigned long sandboxFlags;
|
|
|
|
|
2013-03-21 11:44:58 -07:00
|
|
|
/**
|
|
|
|
* When a new browsing context is opened by a sandboxed document, it needs to
|
|
|
|
* keep track of the browsing context that opened it, so that it can be
|
|
|
|
* navigated by it. This is the "one permitted sandboxed navigator".
|
|
|
|
*/
|
|
|
|
attribute nsIDocShell onePermittedSandboxedNavigator;
|
|
|
|
|
2014-01-12 23:58:16 -08:00
|
|
|
/**
|
|
|
|
* Returns true if we are sandboxed from aTargetDocShell.
|
|
|
|
* aTargetDocShell - the browsing context we are attempting to navigate.
|
|
|
|
*/
|
|
|
|
[noscript,notxpcom,nostdcall] bool isSandboxedFrom(in nsIDocShell aTargetDocShell);
|
|
|
|
|
2013-01-30 00:04:31 -08:00
|
|
|
/**
|
|
|
|
* This member variable determines whether a document has Mixed Active Content that
|
|
|
|
* was initially blocked from loading, but the user has choosen to override the
|
|
|
|
* block and allow the content to load. mMixedContentChannel is set to the document's
|
|
|
|
* channel when the user allows mixed content. The nsMixedContentBlocker content policy
|
|
|
|
* checks if the document's root channel matches the mMixedContentChannel. If it matches,
|
|
|
|
* then Mixed Content is loaded. If it does match, mixed content is blocked.
|
|
|
|
*
|
|
|
|
* A match implies that there is definitely mixed active content on a page that was
|
|
|
|
* initially blocked by nsMixedContentBlocker and then allowed and loaded by the user.
|
|
|
|
* A miss imples that IF there is mixed active content on the page AND it was
|
|
|
|
* blocked by nsMixedContentBlocker.cpp, the user has not choosen to override
|
|
|
|
* the block. Note that if the about:config setting
|
|
|
|
* security.mixed_content.block_active_content is set to false, this boolean
|
|
|
|
* will be false, mMixedContentChannel will remain null since blocking active content has
|
|
|
|
* been disabled and hence mMixedContentChannel will never be set.
|
|
|
|
*/
|
|
|
|
attribute nsIChannel mixedContentChannel;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks whether the channel associated with the root docShell is equal to
|
|
|
|
* mMixedContentChannel. If they are the same, allowMixedContent is set to true.
|
|
|
|
* Checks if the root document has a secure connection. If it is, sets
|
2013-01-30 00:04:34 -08:00
|
|
|
* rootHasSecureConnection to true. If the docShell is the root doc shell,
|
|
|
|
* isRootDocShell is set to true.
|
2013-01-30 00:04:31 -08:00
|
|
|
*/
|
2013-01-30 00:04:34 -08:00
|
|
|
void GetAllowMixedContentAndConnectionData(out boolean rootHasSecureConnection, out boolean allowMixedContent, out boolean isRootDocShell);
|
2013-01-30 00:04:31 -08:00
|
|
|
|
|
|
|
|
2012-08-20 11:34:32 -07:00
|
|
|
/**
|
|
|
|
* Are plugins allowed in the current document loaded in this docshell ?
|
|
|
|
* (if there is one). This depends on whether plugins are allowed by this
|
|
|
|
* docshell itself or if the document is sandboxed and hence plugins should
|
|
|
|
* not be allowed.
|
|
|
|
*/
|
|
|
|
[noscript, notxpcom] bool pluginsAllowedInCurrentDoc();
|
2012-10-07 14:12:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attribute that determines whether fullscreen is allowed to be entered for
|
|
|
|
* this subtree of the docshell tree. This is true when all iframes containing
|
2012-10-29 15:02:24 -07:00
|
|
|
* this docshell have their "allowfullscreen" attribute set to "true".
|
2012-10-07 14:12:50 -07:00
|
|
|
* fullscreenAllowed is only writable at content boundaries, where it is used
|
|
|
|
* to propagate the value of the cross process parent's iframe's
|
2012-10-29 15:02:24 -07:00
|
|
|
* "allowfullscreen" attribute to the child process. Setting
|
2012-10-07 14:12:50 -07:00
|
|
|
* fullscreenAllowed on docshells which aren't content boundaries throws an
|
|
|
|
* exception.
|
|
|
|
*/
|
|
|
|
[infallible] readonly attribute boolean fullscreenAllowed;
|
|
|
|
|
|
|
|
void setFullscreenAllowed(in boolean allowed);
|
2013-01-18 06:27:03 -08:00
|
|
|
|
2013-01-22 10:06:30 -08:00
|
|
|
[noscript, infallible] attribute boolean affectPrivateSessionLifetime;
|
|
|
|
|
2013-01-18 06:27:03 -08:00
|
|
|
/**
|
|
|
|
* Indicates whether the UI may enable the character encoding menu. The UI
|
|
|
|
* must disable the menu when this property is false.
|
|
|
|
*/
|
|
|
|
[infallible] readonly attribute boolean mayEnableCharacterEncodingMenu;
|
2013-02-13 14:39:30 -08:00
|
|
|
|
|
|
|
attribute nsIEditor editor;
|
|
|
|
readonly attribute boolean editable; /* this docShell is editable */
|
|
|
|
readonly attribute boolean hasEditingSession; /* this docShell has an editing session */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Make this docShell editable, setting a flag that causes
|
|
|
|
* an editor to get created, either immediately, or after
|
|
|
|
* a url has been loaded.
|
|
|
|
* @param inWaitForUriLoad true to wait for a URI before
|
|
|
|
* creating the editor.
|
|
|
|
*/
|
|
|
|
void makeEditable(in boolean inWaitForUriLoad);
|
2013-02-15 08:07:29 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the SHEntry associated with a child docshell
|
|
|
|
*/
|
|
|
|
nsISHEntry getChildSHEntry(in long aChildOffset);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a Child SHEntry for a frameset page, given the child's loadtype.
|
|
|
|
* If aCloneChildren is true, then aCloneReference's children will be
|
|
|
|
* cloned onto aHistoryEntry.
|
|
|
|
*/
|
|
|
|
void addChildSHEntry(in nsISHEntry aCloneReference,
|
|
|
|
in nsISHEntry aHistoryEntry,
|
|
|
|
in long aChildOffset,
|
|
|
|
in unsigned long aLoadType,
|
|
|
|
in boolean aCloneChilden);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether this docshell should save entries in global history.
|
|
|
|
*/
|
|
|
|
attribute boolean useGlobalHistory;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes nsISHEntry objects related to this docshell from session history.
|
|
|
|
* Use this only with subdocuments, like iframes.
|
|
|
|
*/
|
|
|
|
void removeFromSessionHistory();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set when an iframe/frame is added dynamically.
|
|
|
|
*/
|
|
|
|
attribute boolean createdDynamically;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns false for mLSHE, true for mOSHE
|
|
|
|
*/
|
|
|
|
boolean getCurrentSHEntry(out nsISHEntry aEntry);
|
2013-08-21 10:24:53 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Cherry picked parts of nsIController.
|
|
|
|
* They are here, because we want to call these functions
|
|
|
|
* from JS.
|
|
|
|
*/
|
|
|
|
boolean isCommandEnabled(in string command);
|
|
|
|
void doCommand(in string command);
|
2013-10-16 06:18:42 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Invisible DocShell are dummy construct to simulate DOM windows
|
|
|
|
* without any actual visual representation. They have to be marked
|
|
|
|
* at construction time, to avoid any painting activity.
|
|
|
|
*/
|
|
|
|
[noscript, notxpcom] bool IsInvisible();
|
|
|
|
[noscript, notxpcom] void SetInvisible(in bool aIsInvisibleDochsell);
|
2013-05-27 03:07:01 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the script global for the document in this docshell.
|
|
|
|
*/
|
|
|
|
[noscript,notxpcom,nostdcall] nsIScriptGlobalObject GetScriptGlobalObject();
|
2013-11-07 17:56:10 -08:00
|
|
|
|
2013-11-07 05:40:23 -08:00
|
|
|
/**
|
|
|
|
* If deviceSizeIsPageSize is set to true, device-width/height media queries
|
|
|
|
* will be calculated from the page size, not the device size.
|
|
|
|
*
|
2013-11-07 05:40:23 -08:00
|
|
|
* Used by the Responsive Design View and B2G Simulator.
|
|
|
|
*
|
|
|
|
* Default is False.
|
|
|
|
* Default value can be overriden with
|
|
|
|
* docshell.device_size_is_page_size pref.
|
2013-11-07 05:40:23 -08:00
|
|
|
*/
|
|
|
|
[infallible] attribute boolean deviceSizeIsPageSize;
|
2014-06-05 19:49:43 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Regarding setOpener / getOpener - We can't use XPIDL's "attribute"
|
|
|
|
* for notxpcom, so we're relegated to using explicit gets / sets. This
|
|
|
|
* should be fine, considering that these methods should only ever be
|
|
|
|
* called from native code.
|
|
|
|
*/
|
|
|
|
[noscript,notxpcom,nostdcall] void setOpener(in nsITabParent aOpener);
|
|
|
|
[noscript,notxpcom,nostdcall] nsITabParent getOpener();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See the documentation for setOpener and getOpener about why we
|
|
|
|
* don't use attribute here instead.
|
|
|
|
*/
|
|
|
|
[noscript,notxpcom,nostdcall] void setOpenedRemote(in nsITabParent aOpenedRemote);
|
|
|
|
[noscript,notxpcom,nostdcall] nsITabParent getOpenedRemote();
|
2014-08-07 17:45:21 -07:00
|
|
|
|
|
|
|
// URLSearchParams for the window.location is owned by the docShell.
|
|
|
|
[noscript,notxpcom] URLSearchParams getURLSearchParams();
|
2014-10-10 14:28:04 -07:00
|
|
|
|
2014-11-13 13:22:24 -08:00
|
|
|
/**
|
|
|
|
* Notify DocShell when the browser is about to start executing JS, and after
|
|
|
|
* that execution has stopped. This only occurs when the Timeline devtool
|
|
|
|
* is collecting information.
|
|
|
|
*/
|
|
|
|
[noscript,notxpcom,nostdcall] void notifyJSRunToCompletionStart();
|
|
|
|
[noscript,notxpcom,nostdcall] void notifyJSRunToCompletionStop();
|
|
|
|
|
2014-10-10 14:28:04 -07:00
|
|
|
/**
|
|
|
|
* This attribute determines whether a document which is not about:blank has
|
|
|
|
* already be loaded by this docShell.
|
|
|
|
*/
|
|
|
|
[infallible] readonly attribute boolean hasLoadedNonBlankURI;
|
|
|
|
|
2010-09-17 14:54:41 -07:00
|
|
|
};
|