docshell/base/nsIDocShell.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/docshell/base/nsIDocShell.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,961 @@
     1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "domstubs.idl"
    1.11 +#include "nsIDocShellTreeItem.idl"
    1.12 +
    1.13 +%{ C++
    1.14 +#include "js/TypeDecls.h"
    1.15 +class nsPresContext;
    1.16 +class nsIPresShell;
    1.17 +%}
    1.18 +
    1.19 +/**
    1.20 + * The nsIDocShell interface.
    1.21 + */
    1.22 +
    1.23 +[ptr] native nsPresContext(nsPresContext);
    1.24 +[ptr] native nsIPresShell(nsIPresShell);
    1.25 +
    1.26 +interface nsIURI;
    1.27 +interface nsIChannel;
    1.28 +interface nsIContentViewer;
    1.29 +interface nsIURIContentListener;
    1.30 +interface nsIDOMEventTarget;
    1.31 +interface nsIDocShellLoadInfo;
    1.32 +interface nsIEditor;
    1.33 +interface nsIWebNavigation;
    1.34 +interface nsISimpleEnumerator;
    1.35 +interface nsIInputStream;
    1.36 +interface nsIRequest;
    1.37 +interface nsISHEntry;
    1.38 +interface nsILayoutHistoryState;
    1.39 +interface nsISecureBrowserUI;
    1.40 +interface nsIScriptGlobalObject;
    1.41 +interface nsIDOMStorage;
    1.42 +interface nsIPrincipal;
    1.43 +interface nsIWebBrowserPrint;
    1.44 +interface nsIVariant;
    1.45 +interface nsIPrivacyTransitionObserver;
    1.46 +interface nsIReflowObserver;
    1.47 +interface nsIScrollObserver;
    1.48 +
    1.49 +typedef unsigned long nsLoadFlags;
    1.50 +
    1.51 +[scriptable, builtinclass, uuid(e46d924d-c20f-4add-8cf5-1e1c817b2181)]
    1.52 +interface nsIDocShell : nsIDocShellTreeItem
    1.53 +{
    1.54 +  /**
    1.55 +   * Loads a given URI.  This will give priority to loading the requested URI
    1.56 +   * in the object implementing	this interface.  If it can't be loaded here
    1.57 +   * however, the URL dispatcher will go through its normal process of content
    1.58 +   * loading.
    1.59 +   *
    1.60 +   * @param uri        - The URI to load.
    1.61 +   * @param loadInfo   - This is the extended load info for this load.  This
    1.62 +   *                     most often will be null, but if you need to do 
    1.63 +   *                     additional setup for this load you can get a loadInfo
    1.64 +   *                     object by calling createLoadInfo.  Once you have this
    1.65 +   *                     object you can set the needed properties on it and
    1.66 +   *                     then pass it to loadURI.
    1.67 +   * @param aLoadFlags - Flags to modify load behaviour. Flags are defined in
    1.68 +   *                     nsIWebNavigation.  Note that using flags outside
    1.69 +   *                     LOAD_FLAGS_MASK is only allowed if passing in a
    1.70 +   *                     non-null loadInfo.  And even some of those might not
    1.71 +   *                     be allowed.  Use at your own risk.
    1.72 +   */
    1.73 +  [noscript]void loadURI(in nsIURI uri,
    1.74 +                         in nsIDocShellLoadInfo loadInfo,
    1.75 +                         in unsigned long aLoadFlags,
    1.76 +                         in boolean firstParty);
    1.77 +
    1.78 +  /**
    1.79 +   * Loads a given stream. This will give priority to loading the requested
    1.80 +   * stream in the object implementing this interface. If it can't be loaded
    1.81 +   * here however, the URL dispatched will go through its normal process of
    1.82 +   * content loading.
    1.83 +   *
    1.84 +   * @param aStream         - The input stream that provides access to the data
    1.85 +   *                          to be loaded.  This must be a blocking, threadsafe
    1.86 +   *                          stream implementation.
    1.87 +   * @param aURI            - The URI representing the stream, or null.
    1.88 +   * @param aContentType    - The type (MIME) of data being loaded (empty if unknown).
    1.89 +   * @param aContentCharset - The charset of the data being loaded (empty if unknown).
    1.90 +   * @param aLoadInfo       - This is the extended load info for this load.  This
    1.91 +   *                          most often will be null, but if you need to do 
    1.92 +   *                          additional setup for this load you can get a
    1.93 +   *                          loadInfo object by calling createLoadInfo.  Once
    1.94 +   *                          you have this object you can set the needed 
    1.95 +   *                          properties on it and then pass it to loadStream.
    1.96 +   */
    1.97 +  [noscript]void loadStream(in nsIInputStream aStream,
    1.98 +                            in nsIURI aURI,
    1.99 +                            in ACString aContentType,
   1.100 +                            in ACString aContentCharset,
   1.101 +                            in nsIDocShellLoadInfo aLoadInfo);
   1.102 +
   1.103 +  const long INTERNAL_LOAD_FLAGS_NONE                    = 0x0;
   1.104 +  const long INTERNAL_LOAD_FLAGS_INHERIT_OWNER           = 0x1;
   1.105 +  const long INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER      = 0x2;
   1.106 +  const long INTERNAL_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 0x4;
   1.107 +
   1.108 +  // This flag marks the first load in this object
   1.109 +  // @see nsIWebNavigation::LOAD_FLAGS_FIRST_LOAD
   1.110 +  const long INTERNAL_LOAD_FLAGS_FIRST_LOAD              = 0x8;
   1.111 +
   1.112 +  const long INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER       = 0x10;
   1.113 +  const long INTERNAL_LOAD_FLAGS_FORCE_ALLOW_COOKIES     = 0x20;
   1.114 +
   1.115 +  // Whether the load should be treated as srcdoc load, rather than a URI one.
   1.116 +  const long INTERNAL_LOAD_FLAGS_IS_SRCDOC               = 0x40;
   1.117 +
   1.118 +  const long INTERNAL_LOAD_FLAGS_FIXUP_SCHEME_TYPOS      = 0x80;
   1.119 +
   1.120 +  /**
   1.121 +   * Loads the given URI.  This method is identical to loadURI(...) except
   1.122 +   * that its parameter list is broken out instead of being packaged inside
   1.123 +   * of an nsIDocShellLoadInfo object...
   1.124 +   *
   1.125 +   * @param aURI            - The URI to load.
   1.126 +   * @param aReferrer       - Referring URI
   1.127 +   * @param aOwner          - Owner (security principal) 
   1.128 +   * @param aInheritOwner   - Flag indicating whether the owner of the current
   1.129 +   *                          document should be inherited if aOwner is null.
   1.130 +   * @param aStopActiveDoc  - Flag indicating whether loading the current
   1.131 +   *                          document should be stopped.
   1.132 +   * @param aWindowTarget   - Window target for the load.
   1.133 +   * @param aTypeHint       - A hint as to the content-type of the resulting
   1.134 +   *                          data.  May be null or empty if no hint.
   1.135 +   * @param aFileName       - Non-null when the link should be downloaded as
   1.136 +                              the given filename.
   1.137 +   * @param aPostDataStream - Post data stream (if POSTing)
   1.138 +   * @param aHeadersStream  - Stream containing "extra" request headers...
   1.139 +   * @param aLoadFlags      - Flags to modify load behaviour. Flags are defined
   1.140 +   *                          in nsIWebNavigation.
   1.141 +   * @param aSHEntry        - Active Session History entry (if loading from SH)
   1.142 +   * @param aSrcdoc           When INTERNAL_LOAD_FLAGS_IS_SRCDOC is set, the
   1.143 +   *                          contents of this parameter will be loaded instead
   1.144 +   *                          of aURI.
   1.145 +   * @param aSourceDocShell - The source browsing context for the navigation.
   1.146 +   * @param aBaseURI        - The base URI to be used for the load.  Set in
   1.147 +   *                          srcdoc loads as it cannot otherwise be inferred
   1.148 +   *                          in certain situations such as view-source.
   1.149 +   */
   1.150 +  [noscript]void internalLoad(in nsIURI aURI,
   1.151 +                              in nsIURI aReferrer,
   1.152 +                              in nsISupports aOwner,
   1.153 +                              in uint32_t aFlags,
   1.154 +                              in wstring aWindowTarget,
   1.155 +                              in string aTypeHint,
   1.156 +                              in AString aFileName,
   1.157 +                              in nsIInputStream aPostDataStream,
   1.158 +                              in nsIInputStream aHeadersStream,
   1.159 +                              in unsigned long aLoadFlags,
   1.160 +                              in nsISHEntry aSHEntry,
   1.161 +                              in boolean firstParty,
   1.162 +                              in AString aSrcdoc,
   1.163 +                              in nsIDocShell aSourceDocShell,
   1.164 +                              in nsIURI aBaseURI,
   1.165 +                              out nsIDocShell aDocShell,
   1.166 +                              out nsIRequest aRequest);
   1.167 +
   1.168 +  /**
   1.169 +   * Do either a history.pushState() or history.replaceState() operation,
   1.170 +   * depending on the value of aReplace.
   1.171 +   */
   1.172 +  [implicit_jscontext]
   1.173 +  void addState(in jsval aData, in DOMString aTitle,
   1.174 +                in DOMString aURL, in boolean aReplace);
   1.175 +
   1.176 +  /**
   1.177 +   * Creates a DocShellLoadInfo object that you can manipulate and then pass
   1.178 +   * to loadURI.
   1.179 +   */
   1.180 +  void createLoadInfo(out nsIDocShellLoadInfo loadInfo);
   1.181 +
   1.182 +  /**
   1.183 +   * Reset state to a new content model within the current document and the document
   1.184 +   * viewer.  Called by the document before initiating an out of band document.write().
   1.185 +   */
   1.186 +  void prepareForNewContentModel();
   1.187 +
   1.188 +  /**
   1.189 +   * For editors and suchlike who wish to change the URI associated with the
   1.190 +   * document. Note if you want to get the current URI, use the read-only
   1.191 +   * property on nsIWebNavigation.
   1.192 +   */ 
   1.193 +  void setCurrentURI(in nsIURI aURI);
   1.194 +
   1.195 +  /**
   1.196 +   * Notify the associated content viewer and all child docshells that they are
   1.197 +   * about to be hidden.  If |isUnload| is true, then the document is being
   1.198 +   * unloaded as well.
   1.199 +   *
   1.200 +   * @param isUnload if true, fire the unload event in addition to the pagehide
   1.201 +   *                 event.
   1.202 +   */
   1.203 +  [noscript] void firePageHideNotification(in boolean isUnload);
   1.204 +
   1.205 +  /**
   1.206 +   * Presentation context for the currently loaded document.  This may be null.
   1.207 +   */
   1.208 +  [noscript] readonly attribute nsPresContext presContext;
   1.209 +
   1.210 +  /**
   1.211 +   * Presentation shell for the currently loaded document.  This may be null.
   1.212 +   */
   1.213 +  [noscript,notxpcom] nsIPresShell GetPresShell();
   1.214 +
   1.215 +  /**
   1.216 +   * Presentation shell for the oldest document, if this docshell is
   1.217 +   * currently transitioning between documents.
   1.218 +   */
   1.219 +  [noscript] readonly attribute nsIPresShell eldestPresShell;
   1.220 +
   1.221 +  /**
   1.222 +   * Content Viewer that is currently loaded for this DocShell.  This may
   1.223 +   * change as the underlying content changes.
   1.224 +   */
   1.225 +  readonly attribute nsIContentViewer contentViewer;
   1.226 +
   1.227 +  /**
   1.228 +   * This attribute allows chrome to tie in to handle DOM events that may
   1.229 +   * be of interest to chrome.
   1.230 +   */
   1.231 +  attribute nsIDOMEventTarget chromeEventHandler;
   1.232 +
   1.233 +  /**
   1.234 +   * Whether to allow plugin execution
   1.235 +   */
   1.236 +  attribute boolean allowPlugins;
   1.237 +
   1.238 +  /**
   1.239 +   * Whether to allow Javascript execution
   1.240 +   */
   1.241 +  attribute boolean allowJavascript;
   1.242 +
   1.243 +  /**
   1.244 +   * Attribute stating if refresh based redirects can be allowed
   1.245 +   */
   1.246 +  attribute  boolean allowMetaRedirects;
   1.247 +
   1.248 +  /**
   1.249 +   * Attribute stating if it should allow subframes (framesets/iframes) or not
   1.250 +   */
   1.251 +  attribute boolean allowSubframes;
   1.252 +
   1.253 +  /**
   1.254 +   * Attribute stating whether or not images should be loaded.
   1.255 +   */
   1.256 +  attribute boolean allowImages;
   1.257 +
   1.258 +  /**
   1.259 +   * Attribute stating whether or not media (audio/video) should be loaded.
   1.260 +   */
   1.261 +  [infallible] attribute boolean allowMedia;
   1.262 +
   1.263 +  /**
   1.264 +   * Attribute that determines whether DNS prefetch is allowed for this subtree
   1.265 +   * of the docshell tree.  Defaults to true.  Setting this will make it take
   1.266 +   * effect starting with the next document loaded in the docshell.
   1.267 +   */
   1.268 +  attribute boolean allowDNSPrefetch;
   1.269 +
   1.270 +  /**
   1.271 +   * Attribute that determines whether window control (move/resize) is allowed.
   1.272 +   */
   1.273 +  attribute boolean allowWindowControl;
   1.274 +
   1.275 +  /**
   1.276 +   * True if the docshell allows its content to be handled by a content listener
   1.277 +   * other than the docshell itself, including the external helper app service,
   1.278 +   * and false otherwise.  Defaults to true.
   1.279 +   */
   1.280 +  [infallible] attribute boolean allowContentRetargeting;
   1.281 +
   1.282 +  /**
   1.283 +   * Get an enumerator over this docShell and its children.
   1.284 +   *
   1.285 +   * @param aItemType  - Only include docShells of this type, or if typeAll,
   1.286 +   *                     include all child shells.
   1.287 +   *                     Uses types from nsIDocShellTreeItem.
   1.288 +   * @param aDirection - Whether to enumerate forwards or backwards.
   1.289 +   */
   1.290 +
   1.291 +  const long ENUMERATE_FORWARDS  = 0;
   1.292 +  const long ENUMERATE_BACKWARDS = 1;
   1.293 +
   1.294 +  nsISimpleEnumerator getDocShellEnumerator(in long aItemType,
   1.295 +                                            in long aDirection);
   1.296 +
   1.297 +  /**
   1.298 +   * The type of application that created this window
   1.299 +   */
   1.300 +  const unsigned long APP_TYPE_UNKNOWN  = 0;
   1.301 +  const unsigned long APP_TYPE_MAIL     = 1;
   1.302 +  const unsigned long APP_TYPE_EDITOR   = 2;
   1.303 +
   1.304 +  attribute unsigned long appType;
   1.305 +
   1.306 +  /**
   1.307 +   * certain dochshells (like the message pane)
   1.308 +   * should not throw up auth dialogs
   1.309 +   * because it can act as a password trojan
   1.310 +   */
   1.311 +  attribute boolean allowAuth;
   1.312 +
   1.313 +  /**
   1.314 +   * Set/Get the document scale factor.  When setting this attribute, a
   1.315 +   * NS_ERROR_NOT_IMPLEMENTED error may be returned by implementations
   1.316 +   * not supporting zoom.  Implementations not supporting zoom should return
   1.317 +   * 1.0 all the time for the Get operation.  1.0 by the way is the default
   1.318 +   * of zoom.  This means 100% of normal scaling or in other words normal size
   1.319 +   * no zoom. 
   1.320 +   */
   1.321 +  attribute float zoom;
   1.322 +
   1.323 +  /*
   1.324 +   * The size, in CSS pixels, of the horizontal margins for the <body> of an
   1.325 +   * HTML document in this docshel; used to implement the marginwidth attribute
   1.326 +   * on HTML <frame>/<iframe> elements.  A value smaller than zero indicates
   1.327 +   * that the attribute was not set.
   1.328 +   */
   1.329 +  attribute long marginWidth;
   1.330 +
   1.331 +  /*
   1.332 +   * The size, in CSS pixels, of the vertical margins for the <body> of an HTML
   1.333 +   * document in this docshel; used to implement the marginheight attribute on
   1.334 +   * HTML <frame>/<iframe> elements.  A value smaller than zero indicates that
   1.335 +   * the attribute was not set.
   1.336 +   */
   1.337 +  attribute long marginHeight;
   1.338 +
   1.339 +  /*
   1.340 +   * Tells the docshell to offer focus to its tree owner.
   1.341 +   * This is currently only necessary for embedding chrome.
   1.342 +   */
   1.343 +  void tabToTreeOwner(in boolean forward,
   1.344 +                      out boolean tookFocus);
   1.345 +
   1.346 +  /**
   1.347 +   * Current busy state for DocShell
   1.348 +   */
   1.349 +  const unsigned long BUSY_FLAGS_NONE             = 0;
   1.350 +  const unsigned long BUSY_FLAGS_BUSY             = 1;
   1.351 +  const unsigned long BUSY_FLAGS_BEFORE_PAGE_LOAD = 2;
   1.352 +  const unsigned long BUSY_FLAGS_PAGE_LOADING     = 4;
   1.353 +
   1.354 +  /**
   1.355 +   * Load commands for the document 
   1.356 +   */
   1.357 +  const unsigned long LOAD_CMD_NORMAL  = 0x1;   // Normal load
   1.358 +  const unsigned long LOAD_CMD_RELOAD  = 0x2;   // Reload
   1.359 +  const unsigned long LOAD_CMD_HISTORY = 0x4;   // Load from history
   1.360 +  const unsigned long LOAD_CMD_PUSHSTATE = 0x8; // History.pushState()
   1.361 +
   1.362 +  readonly attribute unsigned long busyFlags;
   1.363 +
   1.364 +  /* 
   1.365 +   * attribute to access the loadtype  for the document
   1.366 +   */
   1.367 +  attribute unsigned long  loadType;
   1.368 +
   1.369 +  /*
   1.370 +   * Default load flags (as defined in nsIRequest) that will be set on all
   1.371 +   * requests made by this docShell and propagated to all child docShells and
   1.372 +   * to nsILoadGroup::defaultLoadFlags for the docShell's loadGroup.
   1.373 +   * Default is no flags.  Once set, only future requests initiated by the
   1.374 +   * docShell are affected, so in general, these flags should be set before
   1.375 +   * the docShell loads any content.
   1.376 +   */
   1.377 +  attribute nsLoadFlags defaultLoadFlags;
   1.378 +
   1.379 +  /*
   1.380 +   * returns true if the docshell is being destroyed, false otherwise
   1.381 +   */
   1.382 +  boolean isBeingDestroyed();
   1.383 +
   1.384 +  /*
   1.385 +   * Returns true if the docshell is currently executing the onLoad Handler
   1.386 +   */
   1.387 +  readonly attribute boolean isExecutingOnLoadHandler;
   1.388 +
   1.389 +  attribute nsILayoutHistoryState layoutHistoryState;
   1.390 +
   1.391 +  readonly attribute boolean shouldSaveLayoutState;
   1.392 +
   1.393 +  /**
   1.394 +   * The SecureBrowserUI object for this docshell.  This is set by XUL
   1.395 +   * <browser> or nsWebBrowser for their root docshell.
   1.396 +   */
   1.397 +  attribute nsISecureBrowserUI securityUI;
   1.398 +
   1.399 +  /**
   1.400 +   * Cancel the XPCOM timers for each meta-refresh URI in this docshell,
   1.401 +   * and this docshell's children, recursively. The meta-refresh timers can be
   1.402 +   * restarted using resumeRefreshURIs().  If the timers are already suspended,
   1.403 +   * this has no effect.
   1.404 +   */
   1.405 +  void suspendRefreshURIs();
   1.406 +
   1.407 +  /**
   1.408 +   * Restart the XPCOM timers for each meta-refresh URI in this docshell,
   1.409 +   * and this docshell's children, recursively.  If the timers are already
   1.410 +   * running, this has no effect.
   1.411 +   */
   1.412 +  void resumeRefreshURIs();
   1.413 +
   1.414 +  /**
   1.415 +   * Begin firing WebProgressListener notifications for restoring a page
   1.416 +   * presentation. |viewer| is the content viewer whose document we are
   1.417 +   * starting to load.  If null, it defaults to the docshell's current content
   1.418 +   * viewer, creating one if necessary.  |top| should be true for the toplevel
   1.419 +   * docshell that is being restored; it will be set to false when this method
   1.420 +   * is called for child docshells.  This method will post an event to
   1.421 +   * complete the simulated load after returning to the event loop.
   1.422 +   */
   1.423 +  void beginRestore(in nsIContentViewer viewer, in boolean top);
   1.424 +
   1.425 +  /**
   1.426 +   * Finish firing WebProgressListener notifications and DOM events for
   1.427 +   * restoring a page presentation.  This should only be called via
   1.428 +   * beginRestore().
   1.429 +   */
   1.430 +  void finishRestore();
   1.431 +
   1.432 +  /* Track whether we're currently restoring a document presentation. */
   1.433 +  readonly attribute boolean restoringDocument;
   1.434 +
   1.435 +  /* attribute to access whether error pages are enabled */
   1.436 +  attribute boolean useErrorPages;
   1.437 +
   1.438 +  /**
   1.439 +   * Display a load error in a frame while keeping that frame's currentURI
   1.440 +   * pointing correctly to the page where the error ocurred, rather than to
   1.441 +   * the error document page. You must provide either the aURI or aURL parameter.
   1.442 +   *
   1.443 +   * @param  aError         The error code to be displayed
   1.444 +   * @param  aURI           nsIURI of the page where the error happened
   1.445 +   * @param  aURL           wstring of the page where the error happened
   1.446 +   * @param  aFailedChannel The channel related to this error
   1.447 +   */
   1.448 +  void displayLoadError(in nsresult aError,
   1.449 +                        in nsIURI aURI,
   1.450 +                        in wstring aURL,
   1.451 +                        [optional] in nsIChannel aFailedChannel);
   1.452 +
   1.453 +
   1.454 +  /**
   1.455 +   * Keeps track of the previous SHTransaction index and the current
   1.456 +   * SHTransaction index at the time that the doc shell begins to load.
   1.457 +   * Used for ContentViewer eviction.
   1.458 +   */
   1.459 +  readonly attribute long previousTransIndex;
   1.460 +  readonly attribute long loadedTransIndex;
   1.461 +
   1.462 +  /**
   1.463 +   * Notification that entries have been removed from the beginning of a
   1.464 +   * nsSHistory which has this as its rootDocShell.
   1.465 +   *
   1.466 +   * @param numEntries - The number of entries removed
   1.467 +   */
   1.468 +  void historyPurged(in long numEntries);
   1.469 +
   1.470 +  /*
   1.471 +   * @deprecated, use nsIDocShell.QueryInterface(nsIDOMStorageManager) instead.
   1.472 +   *
   1.473 +   * Retrieves the WebApps session storage object for the supplied principal.
   1.474 +   *
   1.475 +   * @param principal returns a storage for this principal
   1.476 +   * @param documentURI new storage will be created with reference to this
   1.477 +   *                    document.documentURI that will appear in storage event
   1.478 +   * @param create If true and a session storage object doesn't
   1.479 +   *               already exist, a new one will be created.
   1.480 +   */
   1.481 +  nsIDOMStorage getSessionStorageForPrincipal(in nsIPrincipal principal,
   1.482 +                                              in DOMString documentURI,
   1.483 +                                              in boolean create);
   1.484 +
   1.485 +  /*
   1.486 +   * @deprecated, use nsIDocShell.QueryInterface(nsIDOMStorageManager) instead.
   1.487 +   *
   1.488 +   * Add a WebApps session storage object to the docshell.
   1.489 +   *
   1.490 +   * @param principal the principal the storage object is associated with
   1.491 +   * @param storage the storage object to add
   1.492 +   */
   1.493 +  void addSessionStorage(in nsIPrincipal principal, in nsIDOMStorage storage);
   1.494 +
   1.495 +  /**
   1.496 +   * Gets the channel for the currently loaded document, if any. 
   1.497 +   * For a new document load, this will be the channel of the previous document
   1.498 +   * until after OnLocationChange fires.
   1.499 +   */
   1.500 +  readonly attribute nsIChannel currentDocumentChannel;
   1.501 +
   1.502 +  /**
   1.503 +   * Set the offset of this child in its container.
   1.504 +   */
   1.505 +  [noscript] void setChildOffset(in unsigned long offset);
   1.506 +
   1.507 +  /**
   1.508 +   * Find out whether the docshell is currently in the middle of a page
   1.509 +   * transition. This is set just before the pagehide/unload events fire.
   1.510 +   */
   1.511 +  readonly attribute boolean isInUnload;
   1.512 +
   1.513 +  /**
   1.514 +   * Find out if the currently loaded document came from a suspicious channel
   1.515 +   * (such as a JAR channel where the server-returned content type isn't a
   1.516 +   * known JAR type).
   1.517 +   */
   1.518 +  readonly attribute boolean channelIsUnsafe;
   1.519 +
   1.520 +  /**
   1.521 +   * This attribute determines whether Mixed Active Content is loaded on the
   1.522 +   * document. When it is true, mixed active content was not blocked and has
   1.523 +   * loaded (or is about to load) on the page. When it is false, mixed active content
   1.524 +   * has not loaded on the page, either because there was no mixed active content
   1.525 +   * requests on the page or such requests were blocked by nsMixedContentBlocker.
   1.526 +   * This boolean is set to true in nsMixedContentBlocker if Mixed Active Content
   1.527 +   * is allowed (either explicitly on the page by the user or when the about:config
   1.528 +   * setting security.mixed_content.block_active_content is set to false).
   1.529 +   */
   1.530 +  [infallible] readonly attribute boolean hasMixedActiveContentLoaded;
   1.531 +
   1.532 +   /**
   1.533 +   * This attribute determines whether a document has Mixed Active Content
   1.534 +   * that has been blocked from loading. When it is true, there is definitely
   1.535 +   * mixed active content on a page that has been blocked by
   1.536 +   * nsMixedContentBlocker.  When it is false, there may or may not be mixed
   1.537 +   * active content on a page, but if there is, it will load. Note that if the
   1.538 +   * about:config setting security.mixed_content.block_active_content is set
   1.539 +   * false, this boolean will be false, since blocking active content has been
   1.540 +   * disabled.
   1.541 +   */
   1.542 +  [infallible] readonly attribute boolean hasMixedActiveContentBlocked;
   1.543 +
   1.544 +  /**
   1.545 +   * This attribute determines whether Mixed Display Content is loaded on the
   1.546 +   * document. When it is true, mixed display content was not blocked and has
   1.547 +   * loaded (or is about to load) on the page. Similar behavior to
   1.548 +   * hasMixedActiveContentLoaded.
   1.549 +   */
   1.550 +  [infallible] readonly attribute boolean hasMixedDisplayContentLoaded;
   1.551 +
   1.552 +   /**
   1.553 +   * This attribute determines whether a document has Mixed Display Content
   1.554 +   * that has been blocked from loading. Similar behavior to
   1.555 +   * hasMixedActiveContentBlocked.
   1.556 +   */
   1.557 +  [infallible] readonly attribute boolean hasMixedDisplayContentBlocked;
   1.558 +
   1.559 +  /**
   1.560 +   * Disconnects this docshell's editor from its window, and stores the
   1.561 +   * editor data in the open document's session history entry.  This
   1.562 +   * should be called only during page transitions.
   1.563 +   */
   1.564 +  [noscript, notxpcom] void DetachEditorFromWindow();
   1.565 +
   1.566 +  /**
   1.567 +   * If true, this browser is not visible in the traditional sense, but
   1.568 +   * is actively being rendered to the screen (ex. painted on a canvas)
   1.569 +   * and should be treated accordingly.
   1.570 +   **/
   1.571 +  attribute boolean isOffScreenBrowser;    
   1.572 +
   1.573 +  /**
   1.574 +   * If the current content viewer isn't initialized for print preview,
   1.575 +   * it is replaced with one which is and to which an about:blank document
   1.576 +   * is loaded.
   1.577 +   */
   1.578 +  readonly attribute nsIWebBrowserPrint printPreview;
   1.579 +
   1.580 +  /**
   1.581 +   * Whether this docshell can execute scripts based on its hierarchy.
   1.582 +   * The rule of thumb here is that we disable js if this docshell or any
   1.583 +   * of its parents disallow scripting.
   1.584 +   */
   1.585 +  [infallible] readonly attribute boolean canExecuteScripts;
   1.586 +
   1.587 +  /**
   1.588 +   * Sets whether a docshell is active. An active docshell is one that is
   1.589 +   * visible, and thus is not a good candidate for certain optimizations
   1.590 +   * like image frame discarding. Docshells are active unless told otherwise.
   1.591 +   */
   1.592 +  attribute boolean isActive;
   1.593 +
   1.594 +  /**
   1.595 +   * The ID of the docshell in the session history.
   1.596 +   */
   1.597 +  readonly attribute unsigned long long historyID;
   1.598 +
   1.599 +  /**
   1.600 +   * Sets whether a docshell is an app tab. An app tab docshell may behave
   1.601 +   * differently than a non-app tab docshell in some cases, such as when
   1.602 +   * handling link clicks. Docshells are not app tabs unless told otherwise.
   1.603 +   */
   1.604 +  attribute boolean isAppTab;
   1.605 +
   1.606 +  /**
   1.607 +   * Create a new about:blank document and content viewer.
   1.608 +   * @param aPrincipal the principal to use for the new document.
   1.609 +   */
   1.610 +  void createAboutBlankContentViewer(in nsIPrincipal aPrincipal);
   1.611 +
   1.612 +  /**
   1.613 +   * Upon getting, returns the canonical encoding label of the document
   1.614 +   * currently loaded into this docshell.
   1.615 +   *
   1.616 +   * Upon setting, sets forcedCharset for compatibility with legacy callers.
   1.617 +   */
   1.618 +  attribute ACString charset;
   1.619 +
   1.620 +  /**
   1.621 +   * Called when the user chose an encoding override from the character
   1.622 +   * encoding menu. Separate from the setter for the charset property to avoid
   1.623 +   * extensions adding noise to the data.
   1.624 +   */
   1.625 +  void gatherCharsetMenuTelemetry();
   1.626 +
   1.627 +  /**
   1.628 +   * The charset forced by the user.
   1.629 +   */
   1.630 +  attribute ACString forcedCharset;
   1.631 +
   1.632 +  /**
   1.633 +   * In a child docshell, this is the charset of the parent docshell
   1.634 +   */
   1.635 +  [noscript, notxpcom, nostdcall] void setParentCharset(
   1.636 +    in ACString parentCharset,
   1.637 +    in int32_t parentCharsetSource,
   1.638 +    in nsIPrincipal parentCharsetPrincipal);
   1.639 +  [noscript, notxpcom, nostdcall] void getParentCharset(
   1.640 +    out ACString parentCharset,
   1.641 +    out int32_t parentCharsetSource,
   1.642 +    out nsIPrincipal parentCharsetPrincipal);
   1.643 +
   1.644 +  /**
   1.645 +   * Add an observer to the list of parties to be notified when this docshell's
   1.646 +   * private browsing status is changed. |obs| must support weak references.
   1.647 +   */
   1.648 +  void addWeakPrivacyTransitionObserver(in nsIPrivacyTransitionObserver obs);
   1.649 +
   1.650 +  /**
   1.651 +   * Add an observer to the list of parties to be notified when reflows are
   1.652 +   * occurring. |obs| must support weak references.
   1.653 +   */
   1.654 +  void addWeakReflowObserver(in nsIReflowObserver obs);
   1.655 +
   1.656 +  /**
   1.657 +   * Remove an observer from the list of parties to be notified about reflows.
   1.658 +   */
   1.659 +  void removeWeakReflowObserver(in nsIReflowObserver obs);
   1.660 +
   1.661 +  /**
   1.662 +   * Notify all attached observers that a reflow has just occurred.
   1.663 +   *
   1.664 +   * @param interruptible if true, the reflow was interruptible.
   1.665 +   * @param start         timestamp when reflow started, in milliseconds since
   1.666 +   *                      navigationStart (accurate to 1/1000 of a ms)
   1.667 +   * @param end           timestamp when reflow ended, in milliseconds since
   1.668 +   *                      navigationStart (accurate to 1/1000 of a ms)
   1.669 +   */
   1.670 +  [noscript] void notifyReflowObservers(in bool interruptible,
   1.671 +                                        in DOMHighResTimeStamp start,
   1.672 +                                        in DOMHighResTimeStamp end);
   1.673 +
   1.674 +  /**
   1.675 +   * Add an observer to the list of parties to be notified when scroll position
   1.676 +   * of some elements is changed.
   1.677 +   */
   1.678 +  [noscript] void addWeakScrollObserver(in nsIScrollObserver obs);
   1.679 +
   1.680 +  /**
   1.681 +   * Add an observer to the list of parties to be notified when scroll position
   1.682 +   * of some elements is changed.
   1.683 +   */
   1.684 +  [noscript] void removeWeakScrollObserver(in nsIScrollObserver obs);
   1.685 +
   1.686 +  /**
   1.687 +   * Notify all attached observers that the scroll position of some element
   1.688 +   * has changed.
   1.689 +   */
   1.690 +  [noscript] void notifyScrollObservers();
   1.691 +
   1.692 +  /**
   1.693 +   * Returns true if this docshell corresponds to an <iframe mozbrowser>.
   1.694 +   * (<iframe mozapp mozbrowser> is not considered a browser.)
   1.695 +   */
   1.696 +  [infallible] readonly attribute boolean isBrowserElement;
   1.697 +
   1.698 +  /**
   1.699 +   * Returns true iff the docshell corresponds to an <iframe mozapp>.
   1.700 +   */
   1.701 +  [infallible] readonly attribute boolean isApp;
   1.702 +
   1.703 +  /**
   1.704 +   * Returns isBrowserElement || isApp.
   1.705 +   */
   1.706 +  [infallible] readonly attribute boolean isBrowserOrApp;
   1.707 +
   1.708 +  /**
   1.709 +   * Returns true if this docshell corresponds to an <iframe mozbrowser> or if
   1.710 +   * the docshell is contained in an <iframe mozbrowser>.  (<iframe mozapp
   1.711 +   * mozbrowser> does not count as a browser.)
   1.712 +   *
   1.713 +   * Our notion here of "contained in" means: Walk up the docshell hierarchy in
   1.714 +   * this process until we hit an <iframe mozapp> or <iframe mozbrowser> (or
   1.715 +   * until the hierarchy ends).  Return true iff the docshell we stopped on has
   1.716 +   * isBrowserElement == true.
   1.717 +   */
   1.718 +  [infallible] readonly attribute boolean isInBrowserElement;
   1.719 +
   1.720 +  /**
   1.721 +   * Returns true if this docshell corresponds to an <iframe mozbrowser> or
   1.722 +   * <iframe mozap>, or if this docshell is contained in an <iframe mozbrowser>
   1.723 +   * or <iframe mozapp>.
   1.724 +   *
   1.725 +   * To compute this value, we walk up the docshell hierarchy.  If we encounter
   1.726 +   * a docshell with isBrowserElement or isApp before we hit the end of the
   1.727 +   * hierarchy, we return true.  Otherwise, we return false.
   1.728 +   */
   1.729 +  [infallible] readonly attribute boolean isInBrowserOrApp;
   1.730 +
   1.731 +   /**
   1.732 +    * Indicate that this docshell corresponds to an app with the given app id.
   1.733 +    *
   1.734 +    * You may pass NO_APP_ID or UNKNOWN_APP_ID for containingAppId.  If you
   1.735 +    * pass NO_APP_ID, then this docshell will return NO_APP_ID for appId.  If
   1.736 +    * you pass UNKNOWN_APP_ID, then this docshell will search its hiearchy for
   1.737 +    * an app frame and use that frame's appId.
   1.738 +    *
   1.739 +    * You can call this method more than once, but there's no guarantee that
   1.740 +    * other components will update their view of the world if you change a
   1.741 +    * docshell's app id, so tread lightly.
   1.742 +    *
   1.743 +    * If you call this method after calling setIsBrowserInsideApp, this
   1.744 +    * docshell will forget the fact that it was a browser.
   1.745 +    */
   1.746 +   void setIsApp(in unsigned long ownAppId);
   1.747 +
   1.748 +   /**
   1.749 +    * Indicate that this docshell corresponds to a browser inside an app with
   1.750 +    * the given ID.  As with setIsApp, you may pass NO_APP_ID or
   1.751 +    * UNKNOWN_APP_ID.
   1.752 +    *
   1.753 +    * As with setIsApp, you may call this more than once, but it's kind of a
   1.754 +    * hack, so be careful.
   1.755 +    */
   1.756 +   void setIsBrowserInsideApp(in unsigned long containingAppId);
   1.757 +
   1.758 +  /**
   1.759 +   * Returns the id of the app associated with this docshell.  If this docshell
   1.760 +   * is an <iframe mozbrowser> inside an <iframe mozapp>, we return the app's
   1.761 +   * appId.
   1.762 +   *
   1.763 +   * We compute this value by walking up the docshell hierarchy until we find a
   1.764 +   * docshell on which setIsApp(x) or setIsBrowserInsideApp(x) was called
   1.765 +   * (ignoring those docshells where x == UNKNOWN_APP_ID).  We return the app
   1.766 +   * id x.
   1.767 +   *
   1.768 +   * If we don't find a docshell with an associated app id in our hierarchy, we
   1.769 +   * return NO_APP_ID.  We never return UNKNOWN_APP_ID.
   1.770 +   *
   1.771 +   * Notice that a docshell may have an associated app even if it returns true
   1.772 +   * for isBrowserElement!
   1.773 +   */
   1.774 +  [infallible] readonly attribute unsigned long appId;
   1.775 +
   1.776 +  /**
   1.777 +   * Return the manifest URL of the app associated with this docshell.
   1.778 +   *
   1.779 +   * If there is no associated app in our hierarchy, we return empty string.
   1.780 +   */
   1.781 +  readonly attribute DOMString appManifestURL;
   1.782 +
   1.783 +  /**
   1.784 +   * Like nsIDocShellTreeItem::GetSameTypeParent, except this ignores <iframe
   1.785 +   * mozbrowser> and <iframe mozapp> boundaries.
   1.786 +   */
   1.787 +  nsIDocShell getSameTypeParentIgnoreBrowserAndAppBoundaries();
   1.788 +
   1.789 +  /** 
   1.790 +   * True iff asynchronous panning and zooming is enabled for this
   1.791 +   * docshell.
   1.792 +   */
   1.793 +  readonly attribute bool asyncPanZoomEnabled;
   1.794 +
   1.795 +  /**
   1.796 +   * The sandbox flags on the docshell. These reflect the value of the sandbox
   1.797 +   * attribute of the associated IFRAME or CSP-protectable content, if
   1.798 +   * existent. See the HTML5 spec for more details.
   1.799 +   * These flags on the docshell reflect the current state of the sandbox
   1.800 +   * attribute, which is modifiable. They are only used when loading new
   1.801 +   * content, sandbox flags are also immutably set on the document when it is
   1.802 +   * loaded.
   1.803 +   * The sandbox flags of a document depend on the sandbox flags on its
   1.804 +   * docshell and of its parent document, if any.
   1.805 +   * See nsSandboxFlags.h for the possible flags.
   1.806 +   */
   1.807 +  attribute unsigned long sandboxFlags;
   1.808 +
   1.809 +  /**
   1.810 +   * When a new browsing context is opened by a sandboxed document, it needs to
   1.811 +   * keep track of the browsing context that opened it, so that it can be
   1.812 +   * navigated by it.  This is the "one permitted sandboxed navigator".
   1.813 +   */
   1.814 +  attribute nsIDocShell onePermittedSandboxedNavigator;
   1.815 +
   1.816 +  /**
   1.817 +   * Returns true if we are sandboxed from aTargetDocShell.
   1.818 +   * aTargetDocShell - the browsing context we are attempting to navigate.
   1.819 +   */
   1.820 +  [noscript,notxpcom,nostdcall] bool isSandboxedFrom(in nsIDocShell aTargetDocShell);
   1.821 +
   1.822 +  /**
   1.823 +   * This member variable determines whether a document has Mixed Active Content that
   1.824 +   * was initially blocked from loading, but the user has choosen to override the
   1.825 +   * block and allow the content to load. mMixedContentChannel is set to the document's
   1.826 +   * channel when the user allows mixed content. The nsMixedContentBlocker content policy
   1.827 +   * checks if the document's root channel matches the mMixedContentChannel.  If it matches,
   1.828 +   * then Mixed Content is loaded.  If it does match, mixed content is blocked.
   1.829 +   *
   1.830 +   * A match implies that there is definitely mixed active content on a page that was
   1.831 +   * initially blocked by nsMixedContentBlocker and then allowed and loaded by the user.
   1.832 +   * A miss imples that IF there is mixed active content on the page AND it was
   1.833 +   * blocked by nsMixedContentBlocker.cpp, the user has not choosen to override
   1.834 +   * the block. Note that if the about:config setting
   1.835 +   * security.mixed_content.block_active_content is set to false, this boolean
   1.836 +   * will be false, mMixedContentChannel will remain null since blocking active content has
   1.837 +   * been disabled and hence mMixedContentChannel will never be set.
   1.838 +   */
   1.839 +  attribute nsIChannel mixedContentChannel;
   1.840 +
   1.841 +  /**
   1.842 +   * Checks whether the channel associated with the root docShell is equal to
   1.843 +   * mMixedContentChannel. If they are the same, allowMixedContent is set to true.
   1.844 +   * Checks if the root document has a secure connection. If it is, sets 
   1.845 +   * rootHasSecureConnection to true. If the docShell is the root doc shell, 
   1.846 +   * isRootDocShell is set to true. 
   1.847 +   */
   1.848 +  void GetAllowMixedContentAndConnectionData(out boolean rootHasSecureConnection, out boolean allowMixedContent, out boolean isRootDocShell);
   1.849 +
   1.850 +
   1.851 +  /**
   1.852 +   * Are plugins allowed in the current document loaded in this docshell ?
   1.853 +   * (if there is one). This depends on whether plugins are allowed by this
   1.854 +   * docshell itself or if the document is sandboxed and hence plugins should
   1.855 +   * not be allowed.
   1.856 +   */
   1.857 +  [noscript, notxpcom] bool pluginsAllowedInCurrentDoc();
   1.858 +  
   1.859 +
   1.860 +  /**
   1.861 +   * Attribute that determines whether fullscreen is allowed to be entered for
   1.862 +   * this subtree of the docshell tree. This is true when all iframes containing
   1.863 +   * this docshell have their "allowfullscreen" attribute set to "true".
   1.864 +   * fullscreenAllowed is only writable at content boundaries, where it is used
   1.865 +   * to propagate the value of the cross process parent's iframe's
   1.866 +   * "allowfullscreen" attribute to the child process. Setting
   1.867 +   * fullscreenAllowed on docshells which aren't content boundaries throws an
   1.868 +   * exception.
   1.869 +   */
   1.870 +  [infallible] readonly attribute boolean fullscreenAllowed;
   1.871 +  
   1.872 +  void setFullscreenAllowed(in boolean allowed);
   1.873 +
   1.874 +  [noscript, infallible] attribute boolean affectPrivateSessionLifetime;
   1.875 +
   1.876 +  /**
   1.877 +   * Indicates whether the UI may enable the character encoding menu. The UI
   1.878 +   * must disable the menu when this property is false.
   1.879 +   */
   1.880 +  [infallible] readonly attribute boolean mayEnableCharacterEncodingMenu;
   1.881 +
   1.882 +           attribute  nsIEditor editor;
   1.883 +  readonly attribute  boolean   editable;             /* this docShell is editable */
   1.884 +  readonly attribute  boolean   hasEditingSession;    /* this docShell has an editing session */
   1.885 +    
   1.886 +  /**
   1.887 +   * Make this docShell editable, setting a flag that causes
   1.888 +   * an editor to get created, either immediately, or after
   1.889 +   * a url has been loaded.
   1.890 +   *      @param  inWaitForUriLoad    true to wait for a URI before
   1.891 +   *                                  creating the editor.
   1.892 +   */     
   1.893 +  void makeEditable(in boolean inWaitForUriLoad);
   1.894 +
   1.895 +  /**
   1.896 +   * Get the SHEntry associated with a child docshell
   1.897 +   */
   1.898 +  nsISHEntry getChildSHEntry(in long aChildOffset);
   1.899 +
   1.900 +  /**
   1.901 +   * Add a Child SHEntry for a frameset page, given the child's loadtype.
   1.902 +   * If aCloneChildren is true, then aCloneReference's children will be
   1.903 +   * cloned onto aHistoryEntry.
   1.904 +   */
   1.905 +  void addChildSHEntry(in nsISHEntry aCloneReference,
   1.906 +                       in nsISHEntry aHistoryEntry,
   1.907 +                       in long aChildOffset,
   1.908 +                       in unsigned long aLoadType,
   1.909 +                       in boolean aCloneChilden);
   1.910 +
   1.911 +  /**
   1.912 +   * Whether this docshell should save entries in global history.
   1.913 +   */
   1.914 +  attribute boolean useGlobalHistory;
   1.915 +
   1.916 +  /**
   1.917 +   * Removes nsISHEntry objects related to this docshell from session history.
   1.918 +   * Use this only with subdocuments, like iframes.
   1.919 +   */
   1.920 +  void removeFromSessionHistory();
   1.921 +
   1.922 +  /**
   1.923 +   * Set when an iframe/frame is added dynamically.
   1.924 +   */
   1.925 +  attribute boolean createdDynamically;
   1.926 +
   1.927 +  /**
   1.928 +   * Returns false for mLSHE, true for mOSHE
   1.929 +   */
   1.930 +  boolean getCurrentSHEntry(out nsISHEntry aEntry);
   1.931 +
   1.932 +  /**
   1.933 +    * Cherry picked parts of nsIController.
   1.934 +    * They are here, because we want to call these functions
   1.935 +    * from JS.
   1.936 +    */
   1.937 +  boolean isCommandEnabled(in string command);
   1.938 +  void doCommand(in string command);
   1.939 +
   1.940 +  /**
   1.941 +   * Invisible DocShell are dummy construct to simulate DOM windows
   1.942 +   * without any actual visual representation. They have to be marked
   1.943 +   * at construction time, to avoid any painting activity.
   1.944 +   */
   1.945 +  [noscript, notxpcom] bool IsInvisible();
   1.946 +  [noscript, notxpcom] void SetInvisible(in bool aIsInvisibleDochsell);
   1.947 +
   1.948 +/**
   1.949 + * Get the script global for the document in this docshell.
   1.950 +*/
   1.951 +  [noscript,notxpcom,nostdcall] nsIScriptGlobalObject GetScriptGlobalObject();
   1.952 +
   1.953 +  /**
   1.954 +   * If deviceSizeIsPageSize is set to true, device-width/height media queries
   1.955 +   * will be calculated from the page size, not the device size.
   1.956 +   *
   1.957 +   * Used by the Responsive Design View and B2G Simulator.
   1.958 +   *
   1.959 +   * Default is False.
   1.960 +   * Default value can be overriden with
   1.961 +   * docshell.device_size_is_page_size pref.
   1.962 +   */
   1.963 +  [infallible] attribute boolean deviceSizeIsPageSize;
   1.964 +};

mercurial