/* -*- Mode: IDL; tab-width: 2; 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/. */ interface LoadContext; interface RemoteTab; interface URI; interface nsIDocShell; interface nsIPrintSettings; interface nsIWebBrowserPersistDocumentReceiver; interface nsIWebProgressListener; [ChromeOnly] interface FrameLoader { /** * Get the docshell from the frame loader. */ [GetterThrows] readonly attribute nsIDocShell? docShell; /** * Get this frame loader's RemoteTab, if it has a remote frame. Otherwise, * returns null. */ readonly attribute RemoteTab? remoteTab; /** * Get an nsILoadContext for the top-level docshell. For remote * frames, a shim is returned that contains private browsing and app * information. */ readonly attribute LoadContext loadContext; /** * Get the root BrowsingContext within the frame. * This may be null immediately after creating a remote frame. */ readonly attribute BrowsingContext? browsingContext; /** * Get the ParentSHistory for the nsFrameLoader. May return null if this * frameloader is not for a toplevel frame. */ readonly attribute ParentSHistory? parentSHistory; /** * Find out whether the loader's frame is at too great a depth in * the frame tree. This can be used to decide what operations may * or may not be allowed on the loader's docshell. */ [Pure] readonly attribute boolean depthTooGreat; /** * Activate remote frame. * Throws an exception with non-remote frames. */ [Throws] void activateRemoteFrame(); /** * Deactivate remote frame. * Throws an exception with non-remote frames. */ [Throws] void deactivateRemoteFrame(); /** * @see nsIDOMWindowUtils sendMouseEvent. */ [Throws] void sendCrossProcessMouseEvent(DOMString aType, float aX, float aY, long aButton, long aClickCount, long aModifiers, optional boolean aIgnoreRootScrollFrame = false); /** * Activate event forwarding from client (remote frame) to parent. */ [Throws] void activateFrameEvent(DOMString aType, boolean capture); // Note, when frameloaders are swapped, also messageManagers are swapped. readonly attribute MessageSender? messageManager; /** * Request that the next time a remote layer transaction has been * received by the Compositor, a MozAfterRemoteFrame event be sent * to the window. */ void requestNotifyAfterRemotePaint(); /** * Force a remote browser to recompute its dimension and screen position. */ [Throws] void requestUpdatePosition(); /** * Print the current document. * * @param aOuterWindowID the ID of the outer window to print * @param aPrintSettings optional print settings to use; printSilent can be * set to prevent prompting. * @param aProgressListener optional print progress listener. */ [Throws] void print(unsigned long long aOuterWindowID, nsIPrintSettings aPrintSettings, optional nsIWebProgressListener? aProgressListener = null); /** * Renders a region of the frame into an image bitmap. * * @param x * @param y * @param w * @param h Specify the area of the window to render, in CSS * pixels. This is relative to the current scroll position. * @param scale The scale to render the window at. Use devicePixelRatio * to have comparable rendering to the OS. * @param backgroundColor The background color to use. * * This API can only be used in the parent process, as content processes * cannot access the rendering of out of process iframes. This API works * with remote and local frames. */ [Throws] Promise drawSnapshot(double x, double y, double w, double h, double scale, DOMString backgroundColor); /** * The element which owns this frame loader. * * For example, if this is a frame loader for an