From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- docshell/base/nsIDocShell.idl | 1186 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1186 insertions(+) create mode 100644 docshell/base/nsIDocShell.idl (limited to 'docshell/base/nsIDocShell.idl') diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl new file mode 100644 index 000000000..8261c45dc --- /dev/null +++ b/docshell/base/nsIDocShell.idl @@ -0,0 +1,1186 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * 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/. */ + +#include "domstubs.idl" +#include "nsIDocShellTreeItem.idl" +#include "nsIRequest.idl" + +%{ C++ +#include "js/TypeDecls.h" +class nsPresContext; +class nsIPresShell; +%} + +/** + * The nsIDocShell interface. + */ + +[ptr] native nsPresContext(nsPresContext); +[ptr] native nsIPresShell(nsIPresShell); + +interface nsIURI; +interface nsIChannel; +interface nsIContentViewer; +interface nsIDOMEventTarget; +interface nsIDocShellLoadInfo; +interface nsIEditor; +interface nsIEditingSession; +interface nsISimpleEnumerator; +interface nsIInputStream; +interface nsIRequest; +interface nsISHEntry; +interface nsILayoutHistoryState; +interface nsISecureBrowserUI; +interface nsIScriptGlobalObject; +interface nsIDOMStorage; +interface nsIPrincipal; +interface nsIWebBrowserPrint; +interface nsIPrivacyTransitionObserver; +interface nsIReflowObserver; +interface nsIScrollObserver; +interface nsITabParent; +interface nsITabChild; +interface nsICommandManager; +interface nsICommandParams; +native TabChildRef(already_AddRefed); + +[scriptable, builtinclass, uuid(049234fe-da10-478b-bc5d-bc6f9a1ba63d)] +interface nsIDocShell : nsIDocShellTreeItem +{ + /** + * 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. + * @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. + */ + [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_PRINCIPAL = 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; + + const long INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER = 0x10; + const long INTERNAL_LOAD_FLAGS_FORCE_ALLOW_COOKIES = 0x20; + + // Whether the load should be treated as srcdoc load, rather than a URI one. + const long INTERNAL_LOAD_FLAGS_IS_SRCDOC = 0x40; + + const long INTERNAL_LOAD_FLAGS_NO_OPENER = 0x100; + + // NB: 0x80 is available. + + /** + * 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 aOriginalURI - The URI to set as the originalURI on the channel + * that does the load. If null, aURI will be set as + * the originalURI. + * @param aLoadReplace - If set LOAD_REPLACE flag will be set on the + * channel. aOriginalURI is null, this argument is + * ignored. + * @param aReferrer - Referring URI + * @param aReferrerPolicy - Referrer policy + * @param aTriggeringPrincipal - A non-null principal that initiated that load. + * Please note that this is the principal that is + * used for security checks. If the argument aURI + * is provided by the web, then please do not pass + * a SystemPrincipal as the triggeringPrincipal. + * @param aPrincipalToInherit - Principal to be inherited for that load. If this + * argument is null then principalToInherit is + * computed as follows: + * a) If INTERNAL_LOAD_FLAGS_INHERIT_PRINCIPAL, and + * aLoadType is not LOAD_NORMAL_EXTERNAL, and the + * URI would normally inherit a principal, then + * principalToInherit is set to the current + * document's principal, or parent document if + * there is not a current document. + * b) If principalToInherit is still null (e.g. if + * some of the conditions of (a) were not satisfied), + * then no inheritance of any sort will happen: the + * load will just get a principal based on the URI + * being loaded. + * @param aFlags - Any of the load flags defined within above. + * @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. + * @param aFileName - Non-null when the link should be downloaded as + the given filename. + * @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) + * @param aSrcdoc When INTERNAL_LOAD_FLAGS_IS_SRCDOC is set, the + * contents of this parameter will be loaded instead + * of aURI. + * @param aSourceDocShell - The source browsing context for the navigation. + * @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. + */ + [noscript]void internalLoad(in nsIURI aURI, + in nsIURI aOriginalURI, + in boolean aLoadReplace, + in nsIURI aReferrer, + in unsigned long aReferrerPolicy, + in nsIPrincipal aTriggeringPrincipal, + in nsIPrincipal aPrincipalToInherit, + in uint32_t aFlags, + in AString aWindowTarget, + in string aTypeHint, + in AString aFileName, + in nsIInputStream aPostDataStream, + in nsIInputStream aHeadersStream, + in unsigned long aLoadFlags, + in nsISHEntry aSHEntry, + in boolean firstParty, + in AString aSrcdoc, + in nsIDocShell aSourceDocShell, + in nsIURI aBaseURI, + out nsIDocShell aDocShell, + out nsIRequest aRequest); + + /** + * Do either a history.pushState() or history.replaceState() operation, + * depending on the value of aReplace. + */ + [implicit_jscontext] + void addState(in jsval aData, in DOMString aTitle, + in DOMString aURL, in boolean aReplace); + + /** + * 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. + * + * @param isUnload if true, fire the unload event in addition to the pagehide + * event. + */ + [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. + */ + [noscript,notxpcom] nsIPresShell GetPresShell(); + + /** + * 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; + + /** + * This allows chrome to set a custom User agent on a specific docshell + */ + attribute DOMString customUserAgent; + + /** + * 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; + + /** + * Attribute stating whether or not media (audio/video) should be loaded. + */ + [infallible] attribute boolean allowMedia; + + /** + * 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; + + /** + * Attribute that determines whether window control (move/resize) is allowed. + */ + attribute boolean allowWindowControl; + + /** + * 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; + + /** + * True if new child docshells should allow content retargeting. + * Setting allowContentRetargeting also overwrites this value. + */ + [infallible] attribute boolean allowContentRetargetingOnChildren; + + /** + * True if this docShell should inherit the private browsing ID from + * its parent when reparented. + * + * NOTE: This should *not* be set false in new code, or for docShells + * inserted anywhere other than as children of panels. + */ + [infallible] attribute boolean inheritPrivateBrowsingId; + + /** + * 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; + + /* + * The size, in CSS pixels, of the horizontal margins for the of an + * HTML document in this docshel; used to implement the marginwidth attribute + * on HTML /