2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2013-04-25 19:13:21 +04: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/.
|
|
|
|
*
|
|
|
|
* 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
|
2016-04-28 13:13:09 +03:00
|
|
|
* https://w3c.github.io/webappsec-secure-contexts/#monkey-patching-global-object
|
2016-08-22 15:52:45 +03:00
|
|
|
* https://w3c.github.io/requestidlecallback/
|
2016-12-17 00:21:51 +03:00
|
|
|
* https://drafts.css-houdini.org/css-paint-api-1/#dom-window-paintworklet
|
2018-08-20 23:28:42 +03:00
|
|
|
* https://wicg.github.io/visual-viewport/#the-visualviewport-interface
|
2013-04-25 19:13:21 +04:00
|
|
|
*/
|
|
|
|
|
2014-02-06 08:37:30 +04:00
|
|
|
interface nsIBrowserDOMWindow;
|
2017-05-18 10:07:25 +03:00
|
|
|
interface XULControllers;
|
2018-07-25 02:47:40 +03:00
|
|
|
interface nsIDOMWindowUtils;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
2018-07-14 01:42:07 +03:00
|
|
|
typedef OfflineResourceList ApplicationCache;
|
|
|
|
|
2013-10-08 19:51:42 +04:00
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
2016-05-10 05:25:40 +03:00
|
|
|
[PrimaryGlobal, LegacyUnenumerableNamedProperties, 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;
|
2015-04-27 20:38:12 +03:00
|
|
|
[Replaceable, Constant, StoreInSlot,
|
|
|
|
CrossOriginReadable] readonly attribute Window self;
|
2014-09-05 22:28:45 +04:00
|
|
|
[Unforgeable, StoreInSlot, Pure] readonly attribute Document? document;
|
2015-09-28 21:25:04 +03:00
|
|
|
[Throws] attribute DOMString name;
|
2017-05-09 23:41:19 +03:00
|
|
|
[PutForwards=href, Unforgeable, BinaryName="getLocation",
|
2017-05-08 16:49:08 +03:00
|
|
|
CrossOriginReadable, CrossOriginWritable] readonly attribute Location location;
|
2013-10-08 19:51:42 +04:00
|
|
|
[Throws] readonly attribute History history;
|
2016-10-12 10:26:02 +03:00
|
|
|
readonly attribute CustomElementRegistry customElements;
|
2013-10-08 19:51:42 +04:00
|
|
|
[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;
|
2017-12-15 01:03:14 +03:00
|
|
|
[Throws, CrossOriginCallable] 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();
|
2017-12-15 01:03:14 +03:00
|
|
|
[Throws, CrossOriginCallable] void focus();
|
2013-12-09 19:34:03 +04:00
|
|
|
[Throws, CrossOriginCallable] void blur();
|
2018-09-25 18:55:09 +03:00
|
|
|
[Replaceable, Pref="dom.window.event.enabled"] readonly attribute any event;
|
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;
|
2018-12-18 23:06:19 +03:00
|
|
|
[Replaceable, CrossOriginReadable] readonly attribute unsigned long length;
|
2014-05-22 22:43:11 +04:00
|
|
|
//[Unforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy top;
|
2018-12-18 23:06:19 +03:00
|
|
|
[Unforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy? top;
|
|
|
|
[Throws, CrossOriginReadable] attribute any opener;
|
2013-10-08 19:51:42 +04:00
|
|
|
//[Throws] readonly attribute WindowProxy parent;
|
2018-12-18 23:06:19 +03:00
|
|
|
[Replaceable, Throws, CrossOriginReadable] readonly attribute WindowProxy? parent;
|
2016-09-29 17:14:42 +03:00
|
|
|
[Throws, NeedsSubjectPrincipal] readonly attribute Element? frameElement;
|
2016-10-20 23:52:38 +03:00
|
|
|
//[Throws] WindowProxy? open(optional USVString url = "about:blank", optional DOMString target = "_blank", [TreatNullAs=EmptyString] optional DOMString features = "");
|
2017-12-15 01:03:14 +03:00
|
|
|
[Throws] WindowProxy? open(optional DOMString url = "", optional DOMString target = "", [TreatNullAs=EmptyString] optional DOMString features = "");
|
2014-09-06 00:36:32 +04:00
|
|
|
getter object (DOMString name);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// the user agent
|
2017-04-14 05:40:03 +03:00
|
|
|
readonly attribute Navigator navigator;
|
2014-03-28 08:03:03 +04:00
|
|
|
#ifdef HAVE_SIDEBAR
|
|
|
|
[Replaceable, Throws] readonly attribute External external;
|
|
|
|
#endif
|
2018-01-12 22:09:30 +03:00
|
|
|
[Throws, Pref="browser.cache.offline.enable", Func="nsGlobalWindowInner::OfflineCacheAllowedForContext"] readonly attribute ApplicationCache applicationCache;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// user prompts
|
2017-12-15 01:03:14 +03:00
|
|
|
[Throws, NeedsSubjectPrincipal] void alert();
|
|
|
|
[Throws, NeedsSubjectPrincipal] void alert(DOMString message);
|
|
|
|
[Throws, NeedsSubjectPrincipal] boolean confirm(optional DOMString message = "");
|
|
|
|
[Throws, NeedsSubjectPrincipal] DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
|
|
|
|
[Throws, Func="nsGlobalWindowInner::IsWindowPrintEnabled"]
|
2017-11-13 18:38:50 +03:00
|
|
|
void print();
|
2013-10-08 19:51:42 +04:00
|
|
|
|
2016-09-29 17:14:42 +03:00
|
|
|
[Throws, CrossOriginCallable, NeedsSubjectPrincipal]
|
2017-02-03 13:00:38 +03:00
|
|
|
void postMessage(any message, DOMString targetOrigin, optional sequence<object> transfer = []);
|
2018-10-29 18:26:30 +03:00
|
|
|
[Throws, CrossOriginCallable, NeedsSubjectPrincipal]
|
|
|
|
void postMessage(any message, optional WindowPostMessageOptions options);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// also has obsolete members
|
|
|
|
};
|
|
|
|
Window implements GlobalEventHandlers;
|
|
|
|
Window implements WindowEventHandlers;
|
|
|
|
|
2016-10-12 22:45:19 +03:00
|
|
|
// https://www.w3.org/TR/appmanifest/#onappinstalled-attribute
|
2016-06-29 20:04:00 +03:00
|
|
|
partial interface Window {
|
2016-10-12 22:45:19 +03:00
|
|
|
[Pref="dom.manifest.onappinstalled"]
|
|
|
|
attribute EventHandler onappinstalled;
|
2016-05-30 19:52:00 +03:00
|
|
|
};
|
|
|
|
|
2013-10-08 19:51:42 +04:00
|
|
|
// 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 {
|
2016-10-11 04:07:48 +03:00
|
|
|
[Throws] readonly attribute Storage? localStorage;
|
2013-10-08 19:51:42 +04:00
|
|
|
};
|
|
|
|
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();
|
|
|
|
};
|
|
|
|
|
|
|
|
// 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 {
|
2017-10-19 17:06:50 +03:00
|
|
|
//[Throws, NewObject, NeedsCallerType] MediaQueryList matchMedia(DOMString query);
|
|
|
|
[Throws, NewObject, NeedsCallerType] MediaQueryList? matchMedia(DOMString query);
|
2015-04-09 05:50:45 +03:00
|
|
|
// Per spec, screen is SameObject, but we don't actually guarantee that given
|
|
|
|
// nsGlobalWindow::Cleanup. :(
|
|
|
|
//[SameObject, Replaceable, Throws] readonly attribute Screen screen;
|
|
|
|
[Replaceable, Throws] readonly attribute Screen screen;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// 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);
|
2017-12-15 01:03:14 +03:00
|
|
|
[Throws, NeedsCallerType] void moveTo(long x, long y);
|
|
|
|
[Throws, NeedsCallerType] void moveBy(long x, long y);
|
|
|
|
[Throws, NeedsCallerType] void resizeTo(long x, long y);
|
|
|
|
[Throws, NeedsCallerType] void resizeBy(long x, long y);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// viewport
|
2015-04-09 05:50:45 +03:00
|
|
|
// These are writable because we allow chrome to write them. And they need
|
|
|
|
// to use 'any' as the type, because non-chrome writing them needs to act
|
|
|
|
// like a [Replaceable] attribute would, which needs the original JS value.
|
|
|
|
//[Replaceable, Throws] readonly attribute double innerWidth;
|
|
|
|
//[Replaceable, Throws] readonly attribute double innerHeight;
|
2016-12-22 22:05:54 +03:00
|
|
|
[Throws, NeedsCallerType] attribute any innerWidth;
|
|
|
|
[Throws, NeedsCallerType] attribute any innerHeight;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// viewport scrolling
|
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();
|
2015-04-09 05:50:45 +03:00
|
|
|
// The four properties below are double per spec at the moment, but whether
|
|
|
|
// that will continue is unclear.
|
2017-03-03 00:01:31 +03:00
|
|
|
[Replaceable, Throws] readonly attribute double scrollX;
|
|
|
|
[Replaceable, Throws] readonly attribute double pageXOffset;
|
|
|
|
[Replaceable, Throws] readonly attribute double scrollY;
|
|
|
|
[Replaceable, Throws] readonly attribute double pageYOffset;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
2018-10-17 05:20:15 +03:00
|
|
|
// Aliases for screenX / screenY.
|
|
|
|
[Replaceable, Throws, NeedsCallerType] readonly attribute double screenLeft;
|
|
|
|
[Replaceable, Throws, NeedsCallerType] readonly attribute double screenTop;
|
|
|
|
|
2013-10-08 19:51:42 +04:00
|
|
|
// client
|
2015-04-09 05:50:45 +03:00
|
|
|
// These are writable because we allow chrome to write them. And they need
|
|
|
|
// to use 'any' as the type, because non-chrome writing them needs to act
|
|
|
|
// like a [Replaceable] attribute would, which needs the original JS value.
|
|
|
|
//[Replaceable, Throws] readonly attribute double screenX;
|
|
|
|
//[Replaceable, Throws] readonly attribute double screenY;
|
|
|
|
//[Replaceable, Throws] readonly attribute double outerWidth;
|
|
|
|
//[Replaceable, Throws] readonly attribute double outerHeight;
|
2016-12-22 22:05:54 +03:00
|
|
|
[Throws, NeedsCallerType] attribute any screenX;
|
|
|
|
[Throws, NeedsCallerType] attribute any screenY;
|
|
|
|
[Throws, NeedsCallerType] attribute any outerWidth;
|
|
|
|
[Throws, NeedsCallerType] attribute any outerHeight;
|
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
|
|
|
|
2016-02-09 18:43:00 +03:00
|
|
|
// https://fidoalliance.org/specifications/download/
|
|
|
|
Window implements GlobalU2F;
|
|
|
|
|
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
|
|
|
|
|
|
|
|
// Mozilla-specific stuff
|
|
|
|
partial interface Window {
|
2017-05-19 07:57:35 +03:00
|
|
|
//[NewObject, Throws] CSSStyleDeclaration getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
|
|
|
|
[NewObject, Throws] CSSStyleDeclaration? getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
|
|
|
|
|
2013-10-08 19:51:42 +04:00
|
|
|
// 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.
|
|
|
|
*/
|
2017-12-15 01:03:14 +03:00
|
|
|
[Throws, NeedsCallerType] void sizeToContent();
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// XXX Shouldn't this be in nsIDOMChromeWindow?
|
2017-05-18 10:07:25 +03:00
|
|
|
[ChromeOnly, Replaceable, Throws] readonly attribute XULControllers controllers;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
2014-06-04 22:11:05 +04:00
|
|
|
[ChromeOnly, Throws] readonly attribute Element? realFrameElement;
|
|
|
|
|
2018-05-22 02:58:23 +03:00
|
|
|
[ChromeOnly] readonly attribute nsIDocShell? docShell;
|
|
|
|
|
2016-12-22 22:05:54 +03:00
|
|
|
[Throws, NeedsCallerType]
|
|
|
|
readonly attribute float mozInnerScreenX;
|
|
|
|
[Throws, NeedsCallerType]
|
|
|
|
readonly attribute float mozInnerScreenY;
|
2016-12-22 22:05:54 +03:00
|
|
|
[Replaceable, Throws, NeedsCallerType]
|
2017-09-25 21:53:09 +03:00
|
|
|
readonly attribute double devicePixelRatio;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
/* The maximum offset that the window can be scrolled to
|
|
|
|
(i.e., the document width/height minus the scrollport width/height) */
|
2015-10-27 07:38:02 +03:00
|
|
|
[ChromeOnly, Throws] readonly attribute long scrollMinX;
|
|
|
|
[ChromeOnly, Throws] readonly attribute long scrollMinY;
|
2013-10-08 19:51:42 +04:00
|
|
|
[Replaceable, Throws] readonly attribute long scrollMaxX;
|
|
|
|
[Replaceable, Throws] readonly attribute long scrollMaxY;
|
|
|
|
|
2017-12-15 01:03:14 +03:00
|
|
|
[Throws] attribute boolean fullScreen;
|
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
|
|
|
|
*/
|
2017-12-15 01:03:14 +03:00
|
|
|
[Throws] 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;
|
|
|
|
|
|
|
|
attribute EventHandler ondevicemotion;
|
|
|
|
attribute EventHandler ondeviceorientation;
|
2015-12-18 01:14:51 +03:00
|
|
|
attribute EventHandler onabsolutedeviceorientation;
|
2013-10-08 19:51:42 +04:00
|
|
|
attribute EventHandler ondeviceproximity;
|
|
|
|
attribute EventHandler onuserproximity;
|
|
|
|
attribute EventHandler ondevicelight;
|
|
|
|
|
|
|
|
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).
|
|
|
|
*/
|
2017-12-15 01:03:14 +03:00
|
|
|
[Throws, ChromeOnly] WindowProxy? openDialog(optional DOMString url = "",
|
|
|
|
optional DOMString name = "",
|
|
|
|
optional DOMString options = "",
|
|
|
|
any... extraArguments);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
2017-09-12 22:33:10 +03:00
|
|
|
[
|
|
|
|
#ifdef NIGHTLY_BUILD
|
|
|
|
ChromeOnly,
|
|
|
|
#endif
|
2017-09-19 04:24:38 +03:00
|
|
|
NonEnumerable, Replaceable, Throws, NeedsCallerType]
|
|
|
|
readonly attribute object? content;
|
2013-12-09 19:34:04 +04:00
|
|
|
|
2018-07-18 07:30:38 +03:00
|
|
|
[Throws, ChromeOnly] any getInterface(any iid);
|
2015-04-17 23:17:26 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Same as nsIDOMWindow.windowRoot, useful for event listener targeting.
|
|
|
|
*/
|
|
|
|
[ChromeOnly, Throws]
|
|
|
|
readonly attribute WindowRoot? windowRoot;
|
2017-12-19 18:04:47 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ChromeOnly method to determine if a particular window should see console
|
|
|
|
* reports from service workers of the given scope.
|
|
|
|
*/
|
|
|
|
[ChromeOnly]
|
|
|
|
boolean shouldReportForServiceWorkerScope(USVString aScope);
|
2018-03-22 06:18:51 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* InstallTrigger is used for extension installs. Ideally it would
|
|
|
|
* be something like a WebIDL namespace, but we don't support
|
|
|
|
* JS-implemented static things yet. See bug 863952.
|
|
|
|
*/
|
|
|
|
[Replaceable]
|
|
|
|
readonly attribute InstallTriggerImpl? InstallTrigger;
|
2018-07-25 02:47:40 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the nsIDOMWindowUtils for this window.
|
|
|
|
*/
|
|
|
|
[Constant, Throws, ChromeOnly]
|
|
|
|
readonly attribute nsIDOMWindowUtils windowUtils;
|
2018-11-19 21:56:18 +03:00
|
|
|
|
|
|
|
[ChromeOnly]
|
|
|
|
readonly attribute boolean hasOpenerForInitialContentBrowser;
|
2013-10-08 19:51:42 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
Window implements TouchEventHandlers;
|
|
|
|
|
|
|
|
Window implements OnErrorEventHandlerForWindow;
|
2014-02-06 08:36:57 +04:00
|
|
|
|
2017-08-12 03:42:11 +03:00
|
|
|
#if defined(MOZ_WIDGET_ANDROID)
|
2015-10-24 07:37:28 +03:00
|
|
|
// https://compat.spec.whatwg.org/#windoworientation-interface
|
|
|
|
partial interface Window {
|
2016-12-22 22:05:54 +03:00
|
|
|
[NeedsCallerType]
|
2015-10-24 07:37:28 +03:00
|
|
|
readonly attribute short orientation;
|
|
|
|
attribute EventHandler onorientationchange;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2014-03-28 08:03:03 +04:00
|
|
|
#ifdef HAVE_SIDEBAR
|
|
|
|
// Mozilla extension
|
|
|
|
partial interface Window {
|
2018-10-31 20:30:18 +03:00
|
|
|
[Replaceable, Throws, UseCounter, Pref="dom.sidebar.enabled"]
|
2014-03-28 08:03:03 +04:00
|
|
|
readonly attribute (External or WindowProxy) sidebar;
|
|
|
|
};
|
|
|
|
#endif
|
2014-02-28 03:39:00 +04:00
|
|
|
|
2018-02-12 04:14:49 +03:00
|
|
|
callback PromiseDocumentFlushedCallback = any ();
|
|
|
|
|
2017-07-06 00:01:04 +03:00
|
|
|
// Mozilla extensions for Chrome windows.
|
|
|
|
partial interface Window {
|
2017-09-19 17:13:22 +03:00
|
|
|
// The STATE_* constants need to match the corresponding enum in nsGlobalWindow.cpp.
|
2017-11-09 23:44:10 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
const unsigned short STATE_MAXIMIZED = 1;
|
2017-11-09 23:44:10 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
const unsigned short STATE_MINIMIZED = 2;
|
2017-11-09 23:44:10 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
const unsigned short STATE_NORMAL = 3;
|
2017-11-09 23:44:10 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
const unsigned short STATE_FULLSCREEN = 4;
|
|
|
|
|
2017-11-09 23:44:10 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
readonly attribute unsigned short windowState;
|
|
|
|
|
2017-11-09 23:44:10 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2017-05-26 13:14:06 +03:00
|
|
|
readonly attribute boolean isFullyOccluded;
|
|
|
|
|
2014-02-06 08:37:30 +04:00
|
|
|
/**
|
|
|
|
* browserDOMWindow provides access to yet another layer of
|
|
|
|
* utility functions implemented by chrome script. It will be null
|
|
|
|
* for DOMWindows not corresponding to browsers.
|
|
|
|
*/
|
2017-11-09 23:44:10 +03:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
attribute nsIBrowserDOMWindow? browserDOMWindow;
|
|
|
|
|
2017-11-09 23:44:10 +03:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
void getAttention();
|
|
|
|
|
2017-11-09 23:44:10 +03:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
void getAttentionWithCycleCount(long aCycleCount);
|
|
|
|
|
2017-11-09 23:44:10 +03:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
void setCursor(DOMString cursor);
|
|
|
|
|
2017-12-15 01:03:14 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
void maximize();
|
2017-12-15 01:03:14 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
void minimize();
|
2017-12-15 01:03:14 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
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.
|
|
|
|
*/
|
2017-11-09 23:44:10 +03:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 08:37:30 +04:00
|
|
|
void notifyDefaultButtonLoaded(Element defaultButton);
|
|
|
|
|
2018-02-14 19:35:39 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2017-06-20 12:09:50 +03:00
|
|
|
readonly attribute ChromeMessageBroadcaster messageManager;
|
2014-02-06 08:37:30 +04:00
|
|
|
|
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.
|
|
|
|
*/
|
2018-02-14 19:35:39 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2017-06-20 12:09:50 +03:00
|
|
|
ChromeMessageBroadcaster getGroupMessageManager(DOMString aGroup);
|
2014-05-23 16:51:56 +04:00
|
|
|
|
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.
|
|
|
|
*
|
|
|
|
* Throws NS_ERROR_NOT_IMPLEMENTED if the OS doesn't support this.
|
|
|
|
*/
|
2017-11-09 23:44:10 +03:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2018-04-24 23:07:20 +03:00
|
|
|
void beginWindowMove(Event mouseDownEvent);
|
2014-02-06 08:36:57 +04:00
|
|
|
|
2018-02-12 04:14:49 +03:00
|
|
|
/**
|
|
|
|
* Calls the given function as soon as a style or layout flush for the
|
|
|
|
* top-level document is not necessary, and returns a Promise which
|
|
|
|
* resolves to the callback's return value after it executes.
|
|
|
|
*
|
|
|
|
* In the event that the window goes away before a flush can occur, the
|
|
|
|
* callback will still be called and the Promise resolved as the window
|
|
|
|
* tears itself down.
|
|
|
|
*
|
|
|
|
* Note that the callback can be called either synchronously or asynchronously
|
|
|
|
* depending on whether or not flushes are pending:
|
|
|
|
*
|
|
|
|
* The callback will be called synchronously when calling
|
|
|
|
* promiseDocumentFlushed when NO flushes are already pending. This is
|
|
|
|
* to ensure that no script has a chance to dirty the DOM before the callback
|
|
|
|
* is called.
|
|
|
|
*
|
|
|
|
* The callback will be called asynchronously if a flush is pending.
|
|
|
|
*
|
|
|
|
* The expected execution order is that all pending callbacks will
|
|
|
|
* be fired first (and in the order that they were queued) and then the
|
|
|
|
* Promise resolution handlers will all be invoked later on during the
|
|
|
|
* next microtask checkpoint.
|
|
|
|
*
|
|
|
|
* promiseDocumentFlushed does not support re-entrancy - so calling it from
|
|
|
|
* within a promiseDocumentFlushed callback will result in the inner call
|
|
|
|
* throwing an NS_ERROR_FAILURE exception, and the outer Promise rejecting
|
|
|
|
* with that exception.
|
|
|
|
*
|
|
|
|
* The callback function *must not make any changes which would require
|
|
|
|
* a style or layout flush*.
|
|
|
|
*
|
|
|
|
* Also throws NS_ERROR_FAILURE if the window is not in a state where flushes
|
|
|
|
* can be waited for (for example, the PresShell has not yet been created).
|
|
|
|
*
|
|
|
|
* @param {function} callback
|
|
|
|
* @returns {Promise}
|
|
|
|
*/
|
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
|
|
|
Promise<any> promiseDocumentFlushed(PromiseDocumentFlushedCallback callback);
|
|
|
|
|
2017-10-06 14:47:27 +03:00
|
|
|
[Func="IsChromeOrXBL"]
|
|
|
|
readonly attribute boolean isChromeWindow;
|
|
|
|
};
|
|
|
|
|
2016-07-05 01:46:49 +03:00
|
|
|
partial interface Window {
|
|
|
|
[Pref="dom.vr.enabled"]
|
|
|
|
attribute EventHandler onvrdisplayconnect;
|
|
|
|
[Pref="dom.vr.enabled"]
|
|
|
|
attribute EventHandler onvrdisplaydisconnect;
|
|
|
|
[Pref="dom.vr.enabled"]
|
2016-10-19 01:18:10 +03:00
|
|
|
attribute EventHandler onvrdisplayactivate;
|
|
|
|
[Pref="dom.vr.enabled"]
|
|
|
|
attribute EventHandler onvrdisplaydeactivate;
|
|
|
|
[Pref="dom.vr.enabled"]
|
2016-07-05 01:46:49 +03:00
|
|
|
attribute EventHandler onvrdisplaypresentchange;
|
|
|
|
};
|
|
|
|
|
2016-12-17 00:21:51 +03:00
|
|
|
// https://drafts.css-houdini.org/css-paint-api-1/#dom-window-paintworklet
|
|
|
|
partial interface Window {
|
2017-03-05 10:20:38 +03:00
|
|
|
[Pref="dom.paintWorklet.enabled", Throws]
|
2016-12-17 00:21:51 +03:00
|
|
|
readonly attribute Worklet paintWorklet;
|
|
|
|
};
|
|
|
|
|
2016-10-10 22:09:00 +03:00
|
|
|
Window implements WindowOrWorkerGlobalScope;
|
2016-08-22 15:52:45 +03:00
|
|
|
|
|
|
|
partial interface Window {
|
2017-11-09 23:44:10 +03:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsRequestIdleCallbackEnabled"]
|
2016-08-22 15:52:45 +03:00
|
|
|
unsigned long requestIdleCallback(IdleRequestCallback callback,
|
|
|
|
optional IdleRequestOptions options);
|
2017-11-09 23:44:10 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsRequestIdleCallbackEnabled"]
|
2016-08-22 15:52:45 +03:00
|
|
|
void cancelIdleCallback(unsigned long handle);
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary IdleRequestOptions {
|
|
|
|
unsigned long timeout;
|
|
|
|
};
|
|
|
|
|
|
|
|
callback IdleRequestCallback = void (IdleDeadline deadline);
|
2017-01-13 03:57:44 +03:00
|
|
|
|
2017-02-20 06:11:00 +03:00
|
|
|
partial interface Window {
|
2017-03-04 05:30:00 +03:00
|
|
|
/**
|
2017-07-15 02:47:23 +03:00
|
|
|
* Returns a list of locales that the internationalization components
|
|
|
|
* should be localized to.
|
|
|
|
*
|
|
|
|
* The function name refers to Regional Preferences which can be either
|
|
|
|
* fetched from the internal internationalization database (CLDR), or
|
|
|
|
* from the host environment.
|
2017-03-04 05:30:00 +03:00
|
|
|
*
|
|
|
|
* The result is a sorted list of valid locale IDs and it should be
|
|
|
|
* used for all APIs that accept list of locales, like ECMA402 and L10n APIs.
|
|
|
|
*
|
|
|
|
* This API always returns at least one locale.
|
|
|
|
*
|
|
|
|
* Example: ["en-US", "de", "pl", "sr-Cyrl", "zh-Hans-HK"]
|
|
|
|
*/
|
2018-11-03 08:31:05 +03:00
|
|
|
[Func="IsChromeOrXBLOrUAWidget"]
|
2017-07-15 02:47:23 +03:00
|
|
|
sequence<DOMString> getRegionalPrefsLocales();
|
2017-03-04 05:30:00 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Getter funcion for IntlUtils, which provides helper functions for
|
|
|
|
* localization.
|
|
|
|
*/
|
2018-11-03 08:31:05 +03:00
|
|
|
[Throws, Func="IsChromeOrXBLOrUAWidget"]
|
2017-03-04 05:30:00 +03:00
|
|
|
readonly attribute IntlUtils intlUtils;
|
2017-02-20 06:11:00 +03:00
|
|
|
};
|
2018-06-13 20:43:48 +03:00
|
|
|
|
|
|
|
Window implements WebGPUProvider;
|
2018-08-20 23:28:42 +03:00
|
|
|
|
|
|
|
partial interface Window {
|
|
|
|
[SameObject, Pref="dom.visualviewport.enabled", Replaceable]
|
|
|
|
readonly attribute VisualViewport visualViewport;
|
|
|
|
|
|
|
|
};
|
2018-10-29 18:26:30 +03:00
|
|
|
|
|
|
|
dictionary WindowPostMessageOptions : PostMessageOptions {
|
|
|
|
USVString targetOrigin = "/";
|
|
|
|
};
|