2013-04-25 19:13:21 +04:00
|
|
|
/* -*- 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/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is:
|
2013-10-08 19:51:42 +04:00
|
|
|
* http://www.whatwg.org/specs/web-apps/current-work/
|
|
|
|
* https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html
|
|
|
|
* https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
|
|
|
|
* http://dev.w3.org/csswg/cssom/
|
|
|
|
* http://dev.w3.org/csswg/cssom-view/
|
2013-04-25 19:13:21 +04:00
|
|
|
* https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html
|
2013-10-08 19:51:42 +04:00
|
|
|
* https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html
|
|
|
|
* https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html
|
|
|
|
* http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
|
2013-04-25 19:13:21 +04:00
|
|
|
*/
|
|
|
|
|
2013-10-08 19:51:42 +04:00
|
|
|
interface ApplicationCache;
|
2014-02-16 01:12:33 +04:00
|
|
|
interface IID;
|
2013-10-08 19:51:42 +04:00
|
|
|
interface MozFrameRequestCallback;
|
2014-02-06 08:37:30 +04:00
|
|
|
interface nsIBrowserDOMWindow;
|
|
|
|
interface nsIMessageBroadcaster;
|
2013-10-08 19:51:42 +04:00
|
|
|
interface nsIDOMCrypto;
|
|
|
|
typedef any Transferable;
|
|
|
|
|
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
2014-11-08 03:07:12 +03:00
|
|
|
[PrimaryGlobal, NeedResolve]
|
2013-10-08 19:51:42 +04:00
|
|
|
/*sealed*/ interface Window : EventTarget {
|
|
|
|
// the current browsing context
|
2014-12-09 22:44:37 +03:00
|
|
|
[Unforgeable, Constant, StoreInSlot,
|
|
|
|
CrossOriginReadable] readonly attribute Window window;
|
2013-12-09 19:34:03 +04:00
|
|
|
[Replaceable, Throws,
|
|
|
|
CrossOriginReadable] readonly attribute WindowProxy self;
|
2014-09-05 22:28:45 +04:00
|
|
|
[Unforgeable, StoreInSlot, Pure] readonly attribute Document? document;
|
2013-10-08 19:51:42 +04:00
|
|
|
[Throws] attribute DOMString name;
|
2013-12-09 19:34:03 +04:00
|
|
|
[PutForwards=href, Unforgeable, Throws,
|
|
|
|
CrossOriginReadable, CrossOriginWritable] readonly attribute Location? location;
|
2013-10-08 19:51:42 +04:00
|
|
|
[Throws] readonly attribute History history;
|
|
|
|
[Replaceable, Throws] readonly attribute BarProp locationbar;
|
|
|
|
[Replaceable, Throws] readonly attribute BarProp menubar;
|
|
|
|
[Replaceable, Throws] readonly attribute BarProp personalbar;
|
|
|
|
[Replaceable, Throws] readonly attribute BarProp scrollbars;
|
|
|
|
[Replaceable, Throws] readonly attribute BarProp statusbar;
|
|
|
|
[Replaceable, Throws] readonly attribute BarProp toolbar;
|
|
|
|
[Throws] attribute DOMString status;
|
2015-01-05 21:43:43 +03:00
|
|
|
[Throws, CrossOriginCallable, UnsafeInPrerendering] void close();
|
2013-12-09 19:34:03 +04:00
|
|
|
[Throws, CrossOriginReadable] readonly attribute boolean closed;
|
2013-10-08 19:51:42 +04:00
|
|
|
[Throws] void stop();
|
2015-01-05 21:43:43 +03:00
|
|
|
[Throws, CrossOriginCallable, UnsafeInPrerendering] void focus();
|
2013-12-09 19:34:03 +04:00
|
|
|
[Throws, CrossOriginCallable] void blur();
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// other browsing contexts
|
2013-12-09 19:34:03 +04:00
|
|
|
[Replaceable, Throws, CrossOriginReadable] readonly attribute WindowProxy frames;
|
|
|
|
[Replaceable, CrossOriginReadable] readonly attribute unsigned long length;
|
2014-05-22 22:43:11 +04:00
|
|
|
//[Unforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy top;
|
|
|
|
[Unforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy? top;
|
2014-06-03 19:38:37 +04:00
|
|
|
[Throws, CrossOriginReadable] attribute any opener;
|
2013-10-08 19:51:42 +04:00
|
|
|
//[Throws] readonly attribute WindowProxy parent;
|
2013-12-09 19:34:03 +04:00
|
|
|
[Replaceable, Throws, CrossOriginReadable] readonly attribute WindowProxy? parent;
|
2013-10-08 19:51:42 +04:00
|
|
|
[Throws] readonly attribute Element? frameElement;
|
2014-05-13 22:08:34 +04:00
|
|
|
//[Throws] WindowProxy open(optional DOMString url = "about:blank", optional DOMString target = "_blank", [TreatNullAs=EmptyString] optional DOMString features = "", optional boolean replace = false);
|
2015-01-05 21:43:43 +03:00
|
|
|
[Throws, UnsafeInPrerendering] WindowProxy? open(optional DOMString url = "", optional DOMString target = "", [TreatNullAs=EmptyString] optional DOMString features = "");
|
2013-10-08 19:51:42 +04:00
|
|
|
// We think the indexed getter is a bug in the spec, it actually needs to live
|
|
|
|
// on the WindowProxy
|
|
|
|
//getter WindowProxy (unsigned long index);
|
2014-09-06 00:36:32 +04:00
|
|
|
getter object (DOMString name);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// the user agent
|
|
|
|
[Throws] readonly attribute Navigator navigator;
|
2014-03-28 08:03:03 +04:00
|
|
|
#ifdef HAVE_SIDEBAR
|
|
|
|
[Replaceable, Throws] readonly attribute External external;
|
|
|
|
#endif
|
2013-10-08 19:51:42 +04:00
|
|
|
[Throws] readonly attribute ApplicationCache applicationCache;
|
|
|
|
|
|
|
|
// user prompts
|
2015-01-05 21:43:43 +03:00
|
|
|
[Throws, UnsafeInPrerendering] void alert();
|
|
|
|
[Throws, UnsafeInPrerendering] void alert(DOMString message);
|
|
|
|
[Throws, UnsafeInPrerendering] boolean confirm(optional DOMString message = "");
|
|
|
|
[Throws, UnsafeInPrerendering] DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
|
|
|
|
[Throws, UnsafeInPrerendering] void print();
|
2013-10-08 19:51:42 +04:00
|
|
|
//[Throws] any showModalDialog(DOMString url, optional any argument);
|
2015-01-05 21:43:43 +03:00
|
|
|
[Throws, Func="nsGlobalWindow::IsShowModalDialogEnabled", UnsafeInPrerendering]
|
2014-07-26 09:41:10 +04:00
|
|
|
any showModalDialog(DOMString url, optional any argument, optional DOMString options = "");
|
2013-10-08 19:51:42 +04:00
|
|
|
|
2013-12-09 19:34:03 +04:00
|
|
|
[Throws, CrossOriginCallable] void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// also has obsolete members
|
|
|
|
};
|
|
|
|
Window implements GlobalEventHandlers;
|
|
|
|
Window implements WindowEventHandlers;
|
|
|
|
|
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
2014-08-05 06:20:34 +04:00
|
|
|
[NoInterfaceObject, Exposed=(Window,Worker)]
|
2013-10-08 19:51:42 +04:00
|
|
|
interface WindowTimers {
|
|
|
|
[Throws] long setTimeout(Function handler, optional long timeout = 0, any... arguments);
|
2014-02-19 19:13:38 +04:00
|
|
|
[Throws] long setTimeout(DOMString handler, optional long timeout = 0, any... unused);
|
2014-02-23 09:01:26 +04:00
|
|
|
[Throws] void clearTimeout(optional long handle = 0);
|
2013-10-08 19:51:42 +04:00
|
|
|
[Throws] long setInterval(Function handler, optional long timeout, any... arguments);
|
2014-02-19 19:13:38 +04:00
|
|
|
[Throws] long setInterval(DOMString handler, optional long timeout, any... unused);
|
2014-02-23 09:01:26 +04:00
|
|
|
[Throws] void clearInterval(optional long handle = 0);
|
2013-10-08 19:51:42 +04:00
|
|
|
};
|
|
|
|
Window implements WindowTimers;
|
|
|
|
|
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
2014-08-05 06:20:34 +04:00
|
|
|
[NoInterfaceObject, Exposed=(Window,Worker)]
|
2013-10-08 19:51:42 +04:00
|
|
|
interface WindowBase64 {
|
|
|
|
[Throws] DOMString btoa(DOMString btoa);
|
|
|
|
[Throws] DOMString atob(DOMString atob);
|
|
|
|
};
|
|
|
|
Window implements WindowBase64;
|
|
|
|
|
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
|
|
|
[NoInterfaceObject]
|
|
|
|
interface WindowSessionStorage {
|
|
|
|
//[Throws] readonly attribute Storage sessionStorage;
|
|
|
|
[Throws] readonly attribute Storage? sessionStorage;
|
|
|
|
};
|
|
|
|
Window implements WindowSessionStorage;
|
|
|
|
|
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
|
|
|
[NoInterfaceObject]
|
|
|
|
interface WindowLocalStorage {
|
|
|
|
[Throws] readonly attribute Storage? localStorage;
|
|
|
|
};
|
|
|
|
Window implements WindowLocalStorage;
|
|
|
|
|
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
|
|
|
partial interface Window {
|
2014-02-09 12:04:39 +04:00
|
|
|
void captureEvents();
|
|
|
|
void releaseEvents();
|
2013-10-08 19:51:42 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html
|
|
|
|
partial interface Window {
|
|
|
|
//[Throws] Selection getSelection();
|
|
|
|
[Throws] Selection? getSelection();
|
|
|
|
};
|
|
|
|
|
|
|
|
// https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
|
|
|
|
Window implements IDBEnvironment;
|
|
|
|
|
|
|
|
// http://dev.w3.org/csswg/cssom/
|
|
|
|
partial interface Window {
|
|
|
|
//[NewObject, Throws] CSSStyleDeclaration getComputedStyle(Element elt, optional DOMString pseudoElt = "");
|
|
|
|
[NewObject, Throws] CSSStyleDeclaration? getComputedStyle(Element elt, optional DOMString pseudoElt = "");
|
|
|
|
};
|
|
|
|
|
|
|
|
// http://dev.w3.org/csswg/cssom-view/
|
|
|
|
enum ScrollBehavior { "auto", "instant", "smooth" };
|
|
|
|
|
|
|
|
dictionary ScrollOptions {
|
|
|
|
ScrollBehavior behavior = "auto";
|
|
|
|
};
|
|
|
|
|
Bug 1045754 - Part 1 - Implement updated CSSOM-View smooth-scrolling specification. r=bz
- Added new WebIDL dictionary, ScrollToOptions. This dictionary extends
ScrollOptions by adding "left" and "top", specifying the scroll offset.
This will be later extended with more members to allow scroll offsets to be
specified with logical axes.
- Implemented Window.Scroll, Window.ScrollTo, Window.ScrollBy, Element.Scroll,
Element.ScrollTo, and Element.ScrollBy functions that accept ScrollToOptions
as a single parameter.
- Removed ScrollOptions dictionary parameter from existing Window.Scroll,
Window.ScrollTo, and Window.ScrollBy functions as these have been replaced
with functions accepting a single parameter, ScrollToOptions.
- Added new WebIDL dictionary, ScrollIntoViewOptions. This dictionary
extends ScrollOptions by adding "block", specifying whether the element
start or end will be scrolled into view.
- Replaced Element.ScrollIntoView(bool,ScrollOptions) with
Element.ScrollIntoView(ScrollIntoViewOptions) to match updated
CSSOM-View scroll-behavior specification.
2014-10-01 21:47:56 +04:00
|
|
|
dictionary ScrollToOptions : ScrollOptions {
|
|
|
|
unrestricted double left;
|
|
|
|
unrestricted double top;
|
|
|
|
};
|
|
|
|
|
2013-10-08 19:51:42 +04:00
|
|
|
partial interface Window {
|
2013-12-16 18:03:34 +04:00
|
|
|
//[Throws,NewObject] MediaQueryList matchMedia(DOMString query);
|
|
|
|
[Throws,NewObject] MediaQueryList? matchMedia(DOMString query);
|
2013-10-08 19:51:42 +04:00
|
|
|
//[SameObject]
|
|
|
|
[Throws] readonly attribute Screen screen;
|
|
|
|
|
|
|
|
// browsing context
|
|
|
|
//[Throws] void moveTo(double x, double y);
|
|
|
|
//[Throws] void moveBy(double x, double y);
|
|
|
|
//[Throws] void resizeTo(double x, double y);
|
|
|
|
//[Throws] void resizeBy(double x, double y);
|
2015-01-05 21:43:43 +03:00
|
|
|
[Throws, UnsafeInPrerendering] void moveTo(long x, long y);
|
|
|
|
[Throws, UnsafeInPrerendering] void moveBy(long x, long y);
|
|
|
|
[Throws, UnsafeInPrerendering] void resizeTo(long x, long y);
|
|
|
|
[Throws, UnsafeInPrerendering] void resizeBy(long x, long y);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// viewport
|
|
|
|
//[Throws] readonly attribute double innerWidth;
|
|
|
|
//[Throws] readonly attribute double innerHeight;
|
|
|
|
[Throws] attribute long innerWidth;
|
|
|
|
[Throws] attribute long innerHeight;
|
|
|
|
|
|
|
|
// viewport scrolling
|
|
|
|
//[Throws] readonly attribute double scrollX;
|
|
|
|
//[Throws] readonly attribute double pageXOffset;
|
|
|
|
//[Throws] readonly attribute double scrollY;
|
|
|
|
//[Throws] readonly attribute double pageYOffset;
|
Bug 1045754 - Part 1 - Implement updated CSSOM-View smooth-scrolling specification. r=bz
- Added new WebIDL dictionary, ScrollToOptions. This dictionary extends
ScrollOptions by adding "left" and "top", specifying the scroll offset.
This will be later extended with more members to allow scroll offsets to be
specified with logical axes.
- Implemented Window.Scroll, Window.ScrollTo, Window.ScrollBy, Element.Scroll,
Element.ScrollTo, and Element.ScrollBy functions that accept ScrollToOptions
as a single parameter.
- Removed ScrollOptions dictionary parameter from existing Window.Scroll,
Window.ScrollTo, and Window.ScrollBy functions as these have been replaced
with functions accepting a single parameter, ScrollToOptions.
- Added new WebIDL dictionary, ScrollIntoViewOptions. This dictionary
extends ScrollOptions by adding "block", specifying whether the element
start or end will be scrolled into view.
- Replaced Element.ScrollIntoView(bool,ScrollOptions) with
Element.ScrollIntoView(ScrollIntoViewOptions) to match updated
CSSOM-View scroll-behavior specification.
2014-10-01 21:47:56 +04:00
|
|
|
void scroll(unrestricted double x, unrestricted double y);
|
|
|
|
void scroll(optional ScrollToOptions options);
|
|
|
|
void scrollTo(unrestricted double x, unrestricted double y);
|
|
|
|
void scrollTo(optional ScrollToOptions options);
|
|
|
|
void scrollBy(unrestricted double x, unrestricted double y);
|
|
|
|
void scrollBy(optional ScrollToOptions options);
|
2015-02-20 03:03:07 +03:00
|
|
|
// mozScrollSnap is used by chrome to perform scroll snapping after the
|
|
|
|
// user performs actions that may affect scroll position
|
|
|
|
// mozScrollSnap is deprecated, to be replaced by a web accessible API, such
|
|
|
|
// as an extension to the ScrollOptions dictionary. See bug 1137937.
|
|
|
|
[ChromeOnly] void mozScrollSnap();
|
2013-10-08 19:51:42 +04:00
|
|
|
[Replaceable, Throws] readonly attribute long scrollX;
|
|
|
|
[Throws] readonly attribute long pageXOffset;
|
|
|
|
[Replaceable, Throws] readonly attribute long scrollY;
|
|
|
|
[Throws] readonly attribute long pageYOffset;
|
|
|
|
|
|
|
|
// client
|
|
|
|
//[Throws] readonly attribute double screenX;
|
|
|
|
//[Throws] readonly attribute double screenY;
|
|
|
|
//[Throws] readonly attribute double outerWidth;
|
|
|
|
//[Throws] readonly attribute double outerHeight;
|
|
|
|
[Throws] attribute long screenX;
|
|
|
|
[Throws] attribute long screenY;
|
|
|
|
[Throws] attribute long outerWidth;
|
|
|
|
[Throws] attribute long outerHeight;
|
|
|
|
};
|
|
|
|
|
2014-05-08 19:32:00 +04:00
|
|
|
/**
|
|
|
|
* Special function that gets the fill ratio from the compositor used for testing
|
|
|
|
* and is an indicator that we're layerizing correctly.
|
|
|
|
* This function will call the given callback current fill ratio for a
|
|
|
|
* composited frame. We don't guarantee which frame fill ratios will be returned.
|
|
|
|
*/
|
|
|
|
partial interface Window {
|
|
|
|
[ChromeOnly, Throws] void mozRequestOverfill(OverfillCallback callback);
|
|
|
|
};
|
|
|
|
callback OverfillCallback = void (unsigned long overfill);
|
|
|
|
|
2013-10-08 19:51:42 +04:00
|
|
|
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html
|
|
|
|
partial interface Window {
|
|
|
|
[Throws] long requestAnimationFrame(FrameRequestCallback callback);
|
|
|
|
[Throws] void cancelAnimationFrame(long handle);
|
|
|
|
};
|
2013-04-25 19:13:21 +04:00
|
|
|
callback FrameRequestCallback = void (DOMHighResTimeStamp time);
|
2013-10-08 19:51:15 +04:00
|
|
|
|
2013-10-08 19:51:42 +04:00
|
|
|
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html
|
|
|
|
partial interface Window {
|
2014-09-06 06:42:33 +04:00
|
|
|
[Replaceable, Pure, StoreInSlot] readonly attribute Performance? performance;
|
2013-10-08 19:51:42 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html
|
2015-02-02 15:49:01 +03:00
|
|
|
Window implements GlobalCrypto;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
#ifdef MOZ_WEBSPEECH
|
|
|
|
// http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
|
|
|
|
[NoInterfaceObject]
|
|
|
|
interface SpeechSynthesisGetter {
|
|
|
|
[Throws, Pref="media.webspeech.synth.enabled"] readonly attribute SpeechSynthesis speechSynthesis;
|
|
|
|
};
|
|
|
|
|
|
|
|
Window implements SpeechSynthesisGetter;
|
|
|
|
#endif
|
|
|
|
|
2014-02-06 01:09:18 +04:00
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
|
|
|
[NoInterfaceObject]
|
|
|
|
interface WindowModal {
|
|
|
|
[Throws, Func="nsGlobalWindow::IsModalContentWindow"] readonly attribute any dialogArguments;
|
|
|
|
[Throws, Func="nsGlobalWindow::IsModalContentWindow"] attribute any returnValue;
|
|
|
|
};
|
|
|
|
Window implements WindowModal;
|
|
|
|
|
2015-03-02 16:22:00 +03:00
|
|
|
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#self-caches
|
|
|
|
partial interface Window {
|
|
|
|
[Throws, Func="mozilla::dom::cache::CacheStorage::PrefEnabled"]
|
|
|
|
readonly attribute CacheStorage caches;
|
|
|
|
};
|
|
|
|
|
2013-10-08 19:51:42 +04:00
|
|
|
// Mozilla-specific stuff
|
|
|
|
partial interface Window {
|
|
|
|
//[NewObject, Throws] CSSStyleDeclaration getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
|
|
|
|
[NewObject, Throws] CSSStyleDeclaration? getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
|
|
|
|
|
|
|
|
[Throws] long mozRequestAnimationFrame(MozFrameRequestCallback aCallback);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancel a refresh callback.
|
|
|
|
*/
|
|
|
|
[Throws] void mozCancelAnimationFrame(long aHandle);
|
|
|
|
// Backwards-compat shim for now to make Google maps work
|
|
|
|
[Throws] void mozCancelRequestAnimationFrame(long aHandle);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The current animation start time in milliseconds since the epoch.
|
|
|
|
*/
|
|
|
|
[Throws] readonly attribute long long mozAnimationStartTime;
|
|
|
|
|
|
|
|
// Mozilla extensions
|
|
|
|
/**
|
|
|
|
* Method for scrolling this window by a number of lines.
|
|
|
|
*/
|
2014-08-06 02:01:32 +04:00
|
|
|
void scrollByLines(long numLines, optional ScrollOptions options);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Method for scrolling this window by a number of pages.
|
|
|
|
*/
|
2014-08-06 02:01:32 +04:00
|
|
|
void scrollByPages(long numPages, optional ScrollOptions options);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Method for sizing this window to the content in the window.
|
|
|
|
*/
|
2015-01-05 21:43:43 +03:00
|
|
|
[Throws, UnsafeInPrerendering] void sizeToContent();
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// XXX Shouldn't this be in nsIDOMChromeWindow?
|
2014-01-17 03:45:40 +04:00
|
|
|
[ChromeOnly, Replaceable, Throws] readonly attribute MozControllers controllers;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
2014-06-04 22:11:05 +04:00
|
|
|
[ChromeOnly, Throws] readonly attribute Element? realFrameElement;
|
|
|
|
|
2013-10-08 19:51:42 +04:00
|
|
|
[Throws] readonly attribute float mozInnerScreenX;
|
|
|
|
[Throws] readonly attribute float mozInnerScreenY;
|
|
|
|
[Throws] readonly attribute float devicePixelRatio;
|
|
|
|
|
|
|
|
/* The maximum offset that the window can be scrolled to
|
|
|
|
(i.e., the document width/height minus the scrollport width/height) */
|
|
|
|
[Replaceable, Throws] readonly attribute long scrollMaxX;
|
|
|
|
[Replaceable, Throws] readonly attribute long scrollMaxY;
|
|
|
|
|
2015-01-05 21:43:43 +03:00
|
|
|
[Throws, UnsafeInPrerendering] attribute boolean fullScreen;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
2015-01-05 21:43:43 +03:00
|
|
|
[Throws, ChromeOnly, UnsafeInPrerendering] void back();
|
|
|
|
[Throws, ChromeOnly, UnsafeInPrerendering] void forward();
|
|
|
|
[Throws, ChromeOnly, UnsafeInPrerendering] void home();
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// XXX Should this be in nsIDOMChromeWindow?
|
2014-07-28 03:21:00 +04:00
|
|
|
void updateCommands(DOMString action,
|
|
|
|
optional Selection? sel = null,
|
|
|
|
optional short reason = 0);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
/* Find in page.
|
|
|
|
* @param str: the search pattern
|
|
|
|
* @param caseSensitive: is the search caseSensitive
|
|
|
|
* @param backwards: should we search backwards
|
|
|
|
* @param wrapAround: should we wrap the search
|
|
|
|
* @param wholeWord: should we search only for whole words
|
|
|
|
* @param searchInFrames: should we search through all frames
|
|
|
|
* @param showDialog: should we show the Find dialog
|
|
|
|
*/
|
2015-01-05 21:43:43 +03:00
|
|
|
[Throws, UnsafeInPrerendering] boolean find(optional DOMString str = "",
|
|
|
|
optional boolean caseSensitive = false,
|
|
|
|
optional boolean backwards = false,
|
|
|
|
optional boolean wrapAround = false,
|
|
|
|
optional boolean wholeWord = false,
|
|
|
|
optional boolean searchInFrames = false,
|
|
|
|
optional boolean showDialog = false);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the number of times this document for this window has
|
|
|
|
* been painted to the screen.
|
|
|
|
*/
|
|
|
|
[Throws] readonly attribute unsigned long long mozPaintCount;
|
|
|
|
|
2014-08-26 18:11:15 +04:00
|
|
|
/**
|
|
|
|
* This property exists because static attributes don't yet work for
|
|
|
|
* JS-implemented WebIDL (see bugs 1058606 and 863952). With this hack, we
|
|
|
|
* can use `MozSelfSupport.something(...)`, which will continue to work
|
|
|
|
* after we ditch this property and switch to static attributes. See
|
|
|
|
*/
|
|
|
|
[ChromeOnly, Throws] readonly attribute MozSelfSupport MozSelfSupport;
|
|
|
|
|
2014-02-16 01:12:33 +04:00
|
|
|
[Pure]
|
|
|
|
attribute EventHandler onwheel;
|
|
|
|
|
2013-10-08 19:51:42 +04:00
|
|
|
attribute EventHandler ondevicemotion;
|
|
|
|
attribute EventHandler ondeviceorientation;
|
|
|
|
attribute EventHandler ondeviceproximity;
|
|
|
|
attribute EventHandler onuserproximity;
|
|
|
|
attribute EventHandler ondevicelight;
|
|
|
|
|
|
|
|
#ifdef MOZ_B2G
|
|
|
|
attribute EventHandler onmoztimechange;
|
|
|
|
attribute EventHandler onmoznetworkupload;
|
|
|
|
attribute EventHandler onmoznetworkdownload;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void dump(DOMString str);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method is here for backwards compatibility with 4.x only,
|
|
|
|
* its implementation is a no-op
|
|
|
|
*/
|
|
|
|
void setResizable(boolean resizable);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the scriptable version of
|
|
|
|
* nsIDOMWindow::openDialog() that takes 3 optional
|
|
|
|
* arguments, plus any additional arguments are passed on as
|
|
|
|
* arguments on the dialog's window object (window.arguments).
|
|
|
|
*/
|
2015-01-05 21:43:43 +03:00
|
|
|
[Throws, ChromeOnly, UnsafeInPrerendering] WindowProxy? openDialog(optional DOMString url = "",
|
|
|
|
optional DOMString name = "",
|
|
|
|
optional DOMString options = "",
|
|
|
|
any... extraArguments);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
2013-10-29 01:03:07 +04:00
|
|
|
[Replaceable, Throws] readonly attribute object? content;
|
2013-12-09 19:34:04 +04:00
|
|
|
|
|
|
|
[ChromeOnly, Throws] readonly attribute object? __content;
|
2014-02-16 01:12:33 +04:00
|
|
|
|
|
|
|
[Throws, ChromeOnly] any getInterface(IID iid);
|
2013-10-08 19:51:42 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
Window implements TouchEventHandlers;
|
|
|
|
|
|
|
|
Window implements OnErrorEventHandlerForWindow;
|
2014-02-06 08:36:57 +04:00
|
|
|
|
2014-02-28 03:39:00 +04:00
|
|
|
// ConsoleAPI
|
|
|
|
partial interface Window {
|
|
|
|
[Replaceable, GetterThrows]
|
|
|
|
readonly attribute Console console;
|
|
|
|
};
|
|
|
|
|
2014-03-28 08:03:03 +04:00
|
|
|
#ifdef HAVE_SIDEBAR
|
|
|
|
// Mozilla extension
|
|
|
|
partial interface Window {
|
|
|
|
[Replaceable, Throws]
|
|
|
|
readonly attribute (External or WindowProxy) sidebar;
|
|
|
|
};
|
|
|
|
#endif
|
2014-02-28 03:39:00 +04:00
|
|
|
|
2014-02-16 01:12:34 +04:00
|
|
|
[Func="IsChromeOrXBL"]
|
|
|
|
interface ChromeWindow {
|
2015-01-26 21:26:33 +03:00
|
|
|
[Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
const unsigned short STATE_MAXIMIZED = 1;
|
2015-01-26 21:26:33 +03:00
|
|
|
[Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
const unsigned short STATE_MINIMIZED = 2;
|
2015-01-26 21:26:33 +03:00
|
|
|
[Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
const unsigned short STATE_NORMAL = 3;
|
2015-01-26 21:26:33 +03:00
|
|
|
[Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
const unsigned short STATE_FULLSCREEN = 4;
|
|
|
|
|
2015-01-26 21:26:33 +03:00
|
|
|
[Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
readonly attribute unsigned short windowState;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* browserDOMWindow provides access to yet another layer of
|
|
|
|
* utility functions implemented by chrome script. It will be null
|
|
|
|
* for DOMWindows not corresponding to browsers.
|
|
|
|
*/
|
2015-01-26 21:26:33 +03:00
|
|
|
[Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
attribute nsIBrowserDOMWindow? browserDOMWindow;
|
|
|
|
|
2015-01-26 21:26:33 +03:00
|
|
|
[Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
void getAttention();
|
|
|
|
|
2015-01-26 21:26:33 +03:00
|
|
|
[Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
void getAttentionWithCycleCount(long aCycleCount);
|
|
|
|
|
2015-01-26 21:26:33 +03:00
|
|
|
[Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
void setCursor(DOMString cursor);
|
|
|
|
|
2015-01-26 21:26:33 +03:00
|
|
|
[Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow", UnsafeInPrerendering]
|
2014-02-06 08:37:30 +04:00
|
|
|
void maximize();
|
2015-01-26 21:26:33 +03:00
|
|
|
[Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow", UnsafeInPrerendering]
|
2014-02-06 08:37:30 +04:00
|
|
|
void minimize();
|
2015-01-26 21:26:33 +03:00
|
|
|
[Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow", UnsafeInPrerendering]
|
2014-02-06 08:37:30 +04:00
|
|
|
void restore();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify a default button is loaded on a dialog or a wizard.
|
|
|
|
* defaultButton is the default button.
|
|
|
|
*/
|
2015-01-26 21:26:33 +03:00
|
|
|
[Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
void notifyDefaultButtonLoaded(Element defaultButton);
|
|
|
|
|
2015-01-26 21:26:33 +03:00
|
|
|
[Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
readonly attribute nsIMessageBroadcaster messageManager;
|
|
|
|
|
2014-05-23 16:51:56 +04:00
|
|
|
/**
|
|
|
|
* Returns the message manager identified by the given group name that
|
|
|
|
* manages all frame loaders belonging to that group.
|
|
|
|
*/
|
2015-01-26 21:26:33 +03:00
|
|
|
[Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-05-23 16:51:56 +04:00
|
|
|
nsIMessageBroadcaster getGroupMessageManager(DOMString aGroup);
|
|
|
|
|
2014-02-06 08:37:30 +04:00
|
|
|
/**
|
|
|
|
* On some operating systems, we must allow the window manager to
|
|
|
|
* handle window dragging. This function tells the window manager to
|
|
|
|
* start dragging the window. This function will fail unless called
|
|
|
|
* while the left mouse button is held down, callers must check this.
|
|
|
|
*
|
|
|
|
* The optional panel argument should be set when moving a panel.
|
|
|
|
*
|
|
|
|
* Throws NS_ERROR_NOT_IMPLEMENTED if the OS doesn't support this.
|
|
|
|
*/
|
2015-01-26 21:26:33 +03:00
|
|
|
[Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
void beginWindowMove(Event mouseDownEvent, optional Element? panel = null);
|
|
|
|
};
|
2014-02-06 08:36:57 +04:00
|
|
|
|
|
|
|
Window implements ChromeWindow;
|
2014-07-25 05:30:07 +04:00
|
|
|
Window implements GlobalFetch;
|