2005-02-08 06:55:00 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
2005-02-08 06:55:00 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2013-03-22 00:05:20 +00:00
|
|
|
interface nsFrameLoader;
|
2005-02-08 06:55:00 +00:00
|
|
|
interface nsIDocShell;
|
2005-09-21 19:14:30 +00:00
|
|
|
interface nsIURI;
|
2009-10-05 11:52:19 +00:00
|
|
|
interface nsIFrame;
|
2013-01-10 07:23:55 +00:00
|
|
|
interface nsSubDocumentFrame;
|
2012-08-27 14:13:02 +00:00
|
|
|
interface nsIMessageSender;
|
2009-11-06 20:43:39 +00:00
|
|
|
interface nsIVariant;
|
2012-05-08 16:20:35 +00:00
|
|
|
interface nsIDOMElement;
|
2013-04-26 00:53:26 +00:00
|
|
|
interface nsITabParent;
|
2014-01-11 01:10:57 +00:00
|
|
|
interface nsILoadContext;
|
2005-02-08 06:55:00 +00:00
|
|
|
|
2014-08-19 14:14:22 +00:00
|
|
|
[scriptable, builtinclass, uuid(55a772b8-855a-4c5f-b4a1-284b6b3bec28)]
|
2005-02-08 06:55:00 +00:00
|
|
|
interface nsIFrameLoader : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get the docshell from the frame loader.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDocShell docShell;
|
|
|
|
|
2013-04-26 00:53:26 +00:00
|
|
|
/**
|
|
|
|
* Get this frame loader's TabParent, if it has a remote frame. Otherwise,
|
|
|
|
* returns null.
|
|
|
|
*/
|
|
|
|
readonly attribute nsITabParent tabParent;
|
|
|
|
|
2014-01-11 01:10:57 +00:00
|
|
|
/**
|
|
|
|
* Get an nsILoadContext for the top-level docshell. For remote
|
|
|
|
* frames, a shim is returned that contains private browsing and app
|
|
|
|
* information.
|
|
|
|
*/
|
|
|
|
readonly attribute nsILoadContext loadContext;
|
|
|
|
|
2005-02-08 06:55:00 +00:00
|
|
|
/**
|
|
|
|
* Start loading the frame. This method figures out what to load
|
|
|
|
* from the owner content in the frame loader.
|
|
|
|
*/
|
|
|
|
void loadFrame();
|
|
|
|
|
2005-09-21 19:14:30 +00:00
|
|
|
/**
|
|
|
|
* Loads the specified URI in this frame. Behaves identically to loadFrame,
|
|
|
|
* except that this method allows specifying the URI to load.
|
|
|
|
*/
|
|
|
|
void loadURI(in nsIURI aURI);
|
|
|
|
|
2005-02-08 06:55:00 +00:00
|
|
|
/**
|
|
|
|
* Destroy the frame loader and everything inside it. This will
|
|
|
|
* clear the weak owner content reference.
|
|
|
|
*/
|
|
|
|
void destroy();
|
2005-08-22 15:44:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean depthTooGreat;
|
2009-10-05 11:52:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the position and size of the subdocument loaded by this frameloader.
|
|
|
|
*
|
|
|
|
* @param aIFrame The nsIFrame for the content node that owns this frameloader
|
|
|
|
*/
|
2013-01-10 07:23:55 +00:00
|
|
|
[noscript] void updatePositionAndSize(in nsSubDocumentFrame aIFrame);
|
2009-11-05 18:14:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Activate remote frame.
|
|
|
|
* Throws an exception with non-remote frames.
|
|
|
|
*/
|
|
|
|
void activateRemoteFrame();
|
2009-11-05 18:21:09 +00:00
|
|
|
|
2011-06-18 00:08:32 +00:00
|
|
|
/**
|
|
|
|
* Deactivate remote frame.
|
|
|
|
* Throws an exception with non-remote frames.
|
|
|
|
*/
|
|
|
|
void deactivateRemoteFrame();
|
|
|
|
|
2009-11-05 18:21:09 +00:00
|
|
|
/**
|
|
|
|
* @see nsIDOMWindowUtils sendMouseEvent.
|
|
|
|
*/
|
|
|
|
void sendCrossProcessMouseEvent(in AString aType,
|
|
|
|
in float aX,
|
|
|
|
in float aY,
|
|
|
|
in long aButton,
|
|
|
|
in long aClickCount,
|
|
|
|
in long aModifiers,
|
|
|
|
[optional] in boolean aIgnoreRootScrollFrame);
|
|
|
|
|
2009-11-17 14:22:23 +00:00
|
|
|
/**
|
|
|
|
* Activate event forwarding from client (remote frame) to parent.
|
|
|
|
*/
|
|
|
|
void activateFrameEvent(in AString aType, in boolean capture);
|
2010-02-20 17:05:20 +00:00
|
|
|
|
2010-05-18 12:28:37 +00:00
|
|
|
// Note, when frameloaders are swapped, also messageManagers are swapped.
|
2012-08-27 14:13:02 +00:00
|
|
|
readonly attribute nsIMessageSender messageManager;
|
2010-03-19 06:52:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see nsIDOMWindowUtils sendKeyEvent.
|
|
|
|
*/
|
|
|
|
void sendCrossProcessKeyEvent(in AString aType,
|
|
|
|
in long aKeyCode,
|
|
|
|
in long aCharCode,
|
|
|
|
in long aModifiers,
|
|
|
|
[optional] in boolean aPreventDefault);
|
|
|
|
|
2014-05-23 18:19:00 +00:00
|
|
|
/**
|
|
|
|
* 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();
|
|
|
|
|
2011-03-25 15:03:35 +00:00
|
|
|
/**
|
|
|
|
* The default rendering mode is synchronous scrolling. In this
|
|
|
|
* mode, it's an error to try to set a target viewport.
|
|
|
|
*/
|
|
|
|
const unsigned long RENDER_MODE_DEFAULT = 0x00000000;
|
2011-01-13 17:45:14 +00:00
|
|
|
|
2010-09-03 20:10:46 +00:00
|
|
|
/**
|
2011-03-25 15:03:35 +00:00
|
|
|
* When asynchronous scrolling is enabled, a target viewport can be
|
|
|
|
* set to transform content pixels wrt its CSS viewport.
|
|
|
|
*
|
|
|
|
* NB: when async scrolling is enabled, it's the *user's*
|
|
|
|
* responsibility to update the target scroll offset. In effect,
|
|
|
|
* the platform hands over control of scroll offset to the user.
|
2010-09-03 20:10:46 +00:00
|
|
|
*/
|
2011-03-25 15:03:35 +00:00
|
|
|
const unsigned long RENDER_MODE_ASYNC_SCROLL = 0x00000001;
|
|
|
|
|
|
|
|
attribute unsigned long renderMode;
|
2011-06-22 00:32:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The default event mode automatically forwards the events
|
2014-04-01 04:09:23 +00:00
|
|
|
* handled in EventStateManager::HandleCrossProcessEvent to
|
2011-06-22 00:32:43 +00:00
|
|
|
* the child content process when these events are targeted to
|
|
|
|
* the remote browser element.
|
|
|
|
*
|
|
|
|
* Used primarly for input events (mouse, keyboard)
|
|
|
|
*/
|
|
|
|
const unsigned long EVENT_MODE_NORMAL_DISPATCH = 0x00000000;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* With this event mode, it's the application's responsability to
|
|
|
|
* convert and forward events to the content process
|
|
|
|
*/
|
|
|
|
const unsigned long EVENT_MODE_DONT_FORWARD_TO_CHILD = 0x00000001;
|
|
|
|
|
|
|
|
attribute unsigned long eventMode;
|
2011-12-05 12:38:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If false, then the subdocument is not clipped to its CSS viewport, and the
|
|
|
|
* subdocument's viewport scrollbar(s) are not rendered.
|
|
|
|
* Defaults to true.
|
|
|
|
*/
|
|
|
|
attribute boolean clipSubdocument;
|
2012-02-17 23:41:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If false, then the subdocument's scroll coordinates will not be clamped
|
|
|
|
* to their scroll boundaries.
|
|
|
|
* Defaults to true.
|
|
|
|
*/
|
|
|
|
attribute boolean clampScrollPosition;
|
2012-05-08 16:20:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The element which owns this frame loader.
|
|
|
|
*
|
|
|
|
* For example, if this is a frame loader for an <iframe>, this attribute
|
|
|
|
* returns the iframe element.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDOMElement ownerElement;
|
2013-04-26 00:53:26 +00:00
|
|
|
|
2013-09-12 19:24:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Cached childID of the ContentParent owning the TabParent in this frame
|
|
|
|
* loader. This can be used to obtain the childID after the TabParent died.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long long childID;
|
|
|
|
|
2013-04-26 00:53:26 +00:00
|
|
|
/**
|
|
|
|
* Get or set this frame loader's visibility.
|
|
|
|
*
|
|
|
|
* The notion of "visibility" here is separate from the notion of a
|
|
|
|
* window/docshell's visibility. This field is mostly here so that we can
|
|
|
|
* have a notion of visibility in the parent process when frames are OOP.
|
|
|
|
*/
|
|
|
|
[infallible] attribute boolean visible;
|
2014-02-20 22:19:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Find out whether the owner content really is a browser or app frame
|
2014-08-19 14:14:08 +00:00
|
|
|
* Especially, a widget frame is regarded as an app frame.
|
2014-02-20 22:19:18 +00:00
|
|
|
*/
|
|
|
|
readonly attribute boolean ownerIsBrowserOrAppFrame;
|
2014-08-19 14:14:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Find out whether the owner content really is a widget. If this attribute
|
|
|
|
* returns true, |ownerIsBrowserOrAppFrame| must return true.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean ownerIsWidget;
|
|
|
|
|
2005-02-08 06:55:00 +00:00
|
|
|
};
|
|
|
|
|
2013-03-17 07:55:15 +00:00
|
|
|
%{C++
|
|
|
|
class nsFrameLoader;
|
|
|
|
%}
|
|
|
|
|
2009-10-20 21:33:59 +00:00
|
|
|
native alreadyAddRefed_nsFrameLoader(already_AddRefed<nsFrameLoader>);
|
|
|
|
|
2009-11-06 20:43:39 +00:00
|
|
|
[scriptable, uuid(5879040e-83e9-40e3-b2bb-5ddf43b76e47)]
|
2005-02-08 06:55:00 +00:00
|
|
|
interface nsIFrameLoaderOwner : nsISupports
|
|
|
|
{
|
2008-08-07 23:15:40 +00:00
|
|
|
/**
|
|
|
|
* The frame loader owned by this nsIFrameLoaderOwner
|
|
|
|
*/
|
2005-02-08 06:55:00 +00:00
|
|
|
readonly attribute nsIFrameLoader frameLoader;
|
2009-10-20 21:33:59 +00:00
|
|
|
[noscript, notxpcom] alreadyAddRefed_nsFrameLoader GetFrameLoader();
|
2008-08-07 23:15:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Swap frame loaders with the given nsIFrameLoaderOwner. This may
|
|
|
|
* only be posible in a very limited range of circumstances, or
|
|
|
|
* never, depending on the object implementing this interface.
|
|
|
|
*
|
|
|
|
* @throws NS_ERROR_NOT_IMPLEMENTED if the swapping logic is not
|
|
|
|
* implemented for the two given frame loader owners.
|
|
|
|
* @throws NS_ERROR_DOM_SECURITY_ERR if the swap is not allowed on
|
|
|
|
* security grounds.
|
|
|
|
*/
|
|
|
|
void swapFrameLoaders(in nsIFrameLoaderOwner aOtherOwner);
|
2005-02-08 06:55:00 +00:00
|
|
|
};
|