1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
10 interface nsIDocShell;
11 interface nsIPrintSettings;
12 interface nsIWebBrowserPersistDocumentReceiver;
13 interface nsIWebProgressListener;
17 interface FrameLoader {
19 * Get the docshell from the frame loader.
22 readonly attribute nsIDocShell? docShell;
25 * Get this frame loader's RemoteTab, if it has a remote frame. Otherwise,
28 readonly attribute RemoteTab? remoteTab;
31 * Get an nsILoadContext for the top-level docshell. For remote
32 * frames, a shim is returned that contains private browsing and app
35 readonly attribute LoadContext? loadContext;
38 * Get the root BrowsingContext within the frame.
39 * This may be null immediately after creating a remote frame.
41 readonly attribute BrowsingContext? browsingContext;
44 * Find out whether the loader's frame is at too great a depth in
45 * the frame tree. This can be used to decide what operations may
46 * or may not be allowed on the loader's docshell.
49 readonly attribute boolean depthTooGreat;
52 * Find out whether the loader's frame is a remote frame.
54 readonly attribute boolean isRemoteFrame;
56 // Note, when frameloaders are swapped, also messageManagers are swapped.
57 readonly attribute MessageSender? messageManager;
60 * Force a remote browser to recompute its dimension and screen position.
63 undefined requestUpdatePosition();
66 * Force a TabStateFlush from native sessionStoreListeners.
67 * Returns a promise that resolves when all session store data has been
71 Promise<undefined> requestTabStateFlush();
74 * Force Epoch update in native sessionStoreListeners.
76 undefined requestEpochUpdate(unsigned long aEpoch);
79 * Request a session history update in native sessionStoreListeners.
81 undefined requestSHistoryUpdate();
84 * Creates a print preview document in this frame, or updates the existing
85 * print preview document with new print settings.
87 * @param aPrintSettings The print settings to use to layout the print
89 * @param aSourceBrowsingContext Optionally, the browsing context that
90 * contains the document from which the print preview is to be generated,
91 * which must be in the same process as the browsing context of the frame
94 * This should only be passed on the first call. It should not be passed
95 * for any subsequent calls that are made to update the existing print
96 * preview document with a new print settings object.
97 * @return A Promise that resolves with a PrintPreviewSuccessInfo on success.
100 Promise<unsigned long> printPreview(nsIPrintSettings aPrintSettings,
101 BrowsingContext? aSourceBrowsingContext);
104 * Inform the print preview document that we're done with it.
106 undefined exitPrintPreview();
109 * The element which owns this frame loader.
111 * For example, if this is a frame loader for an <iframe>, this attribute
112 * returns the iframe element.
115 readonly attribute Element? ownerElement;
119 * Cached childID of the ContentParent owning the RemoteTab in this frame
120 * loader. This can be used to obtain the childID after the RemoteTab died.
123 readonly attribute unsigned long long childID;
126 * Find out whether the owner content really is a mozbrowser. <xul:browser>
127 * is not considered to be a mozbrowser frame.
130 readonly attribute boolean ownerIsMozBrowserFrame;
133 * The last known width of the frame. Reading this property will not trigger
134 * a reflow, and therefore may not reflect the current state of things. It
135 * should only be used in asynchronous APIs where values are not guaranteed
136 * to be up-to-date when received.
139 readonly attribute unsigned long lazyWidth;
142 * The last known height of the frame. Reading this property will not trigger
143 * a reflow, and therefore may not reflect the current state of things. It
144 * should only be used in asynchronous APIs where values are not guaranteed
145 * to be up-to-date when received.
148 readonly attribute unsigned long lazyHeight;
151 * Is `true` if the frameloader is dead (destroy has been called on it)
154 readonly attribute boolean isDead;
158 * Interface for objects which represent a document that can be
159 * serialized with nsIWebBrowserPersist. This interface is
160 * asynchronous because the actual document can be in another process
161 * (e.g., if this object is a FrameLoader for an out-of-process
164 * @see nsIWebBrowserPersistDocumentReceiver
165 * @see nsIWebBrowserPersistDocument
166 * @see nsIWebBrowserPersist
169 * The browsing context of the subframe we'd like to persist.
170 * If set to nullptr, WebBrowserPersistable will attempt to persist
171 * the top-level document. If the browsing context is for a subframe
172 * that is not held beneath the WebBrowserPersistable, aRecv's onError
173 * method will be called with NS_ERROR_NO_CONTENT.
175 * The nsIWebBrowserPersistDocumentReceiver is a callback that
176 * will be fired once the document is ready for persisting.
178 interface mixin WebBrowserPersistable
181 undefined startPersistence(BrowsingContext? aContext,
182 nsIWebBrowserPersistDocumentReceiver aRecv);
185 enum PrintPreviewOrientation {
192 * Interface for the object that's used to resolve the Promise returned from
193 * FrameLoader.printPreview() if that method successfully creates the print
194 * preview document/successfully updates it with new settings.
196 [GenerateConversionToJS]
197 dictionary PrintPreviewSuccessInfo {
199 * The total number of sheets of paper required to print, taking into account
200 * the provided nsIPrintSettings. This takes into account page range
201 * selection, the pages-per-sheet, whether duplex printing is enabled, etc.
203 unsigned long sheetCount = 0;
206 * The total number of virtual pages, not taking into account page range
207 * selection, the pages-per-sheet, whether duplex printing is enabled, etc.
209 unsigned long totalPageCount = 0;
212 * Whether the preview is empty because of page range selection.
214 boolean isEmpty = false;
217 * Whether the document or any subdocument has a selection that can be
220 boolean hasSelection = false;
223 * Whether the previewed document has a selection itself.
225 boolean hasSelfSelection = false;
228 * Specified orientation of the document, or "unspecified".
230 PrintPreviewOrientation orientation = "unspecified";
233 * Specified page width of the document in inches, or null if no @page size was specified.
235 float? pageWidth = null;
238 * Specified page height of the document in inches, or null if no @page size was specified.
240 float? pageHeight = null;
243 FrameLoader includes WebBrowserPersistable;