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/
|
2019-09-27 18:26:14 +03:00
|
|
|
[Global, LegacyUnenumerableNamedProperties, NeedResolve,
|
2019-10-29 19:20:49 +03:00
|
|
|
Exposed=Window,
|
|
|
|
InstrumentedProps=(AbsoluteOrientationSensor,
|
|
|
|
Accelerometer,
|
|
|
|
ApplicationCache,
|
|
|
|
ApplicationCacheErrorEvent,
|
|
|
|
Atomics,
|
|
|
|
AudioParamMap,
|
|
|
|
AudioWorklet,
|
|
|
|
AudioWorkletNode,
|
|
|
|
BackgroundFetchManager,
|
|
|
|
BackgroundFetchRecord,
|
|
|
|
BackgroundFetchRegistration,
|
|
|
|
BeforeInstallPromptEvent,
|
|
|
|
Bluetooth,
|
|
|
|
BluetoothCharacteristicProperties,
|
|
|
|
BluetoothDevice,
|
|
|
|
BluetoothRemoteGATTCharacteristic,
|
|
|
|
BluetoothRemoteGATTDescriptor,
|
|
|
|
BluetoothRemoteGATTServer,
|
|
|
|
BluetoothRemoteGATTService,
|
|
|
|
BluetoothUUID,
|
|
|
|
CanvasCaptureMediaStreamTrack,
|
|
|
|
chrome,
|
|
|
|
clientInformation,
|
|
|
|
ClipboardItem,
|
|
|
|
CSSImageValue,
|
|
|
|
CSSKeywordValue,
|
|
|
|
CSSMathInvert,
|
|
|
|
CSSMathMax,
|
|
|
|
CSSMathMin,
|
|
|
|
CSSMathNegate,
|
|
|
|
CSSMathProduct,
|
|
|
|
CSSMathSum,
|
|
|
|
CSSMathValue,
|
|
|
|
CSSMatrixComponent,
|
|
|
|
CSSNumericArray,
|
|
|
|
CSSNumericValue,
|
|
|
|
CSSPerspective,
|
|
|
|
CSSPositionValue,
|
|
|
|
CSSRotate,
|
|
|
|
CSSScale,
|
|
|
|
CSSSkew,
|
|
|
|
CSSSkewX,
|
|
|
|
CSSSkewY,
|
|
|
|
CSSStyleValue,
|
|
|
|
CSSTransformComponent,
|
|
|
|
CSSTransformValue,
|
|
|
|
CSSTranslate,
|
|
|
|
CSSUnitValue,
|
|
|
|
CSSUnparsedValue,
|
|
|
|
CSSVariableReferenceValue,
|
|
|
|
defaultStatus,
|
|
|
|
// Unfortunately, our telemetry histogram name generator
|
|
|
|
// (the one that generates TelemetryHistogramEnums.h) can't
|
|
|
|
// handle two DOM methods with names that only differ in
|
|
|
|
// case, because it forces everything to uppercase.
|
|
|
|
//defaultstatus,
|
|
|
|
DeviceMotionEventAcceleration,
|
|
|
|
DeviceMotionEventRotationRate,
|
|
|
|
DOMError,
|
|
|
|
EnterPictureInPictureEvent,
|
|
|
|
External,
|
|
|
|
FederatedCredential,
|
|
|
|
Gyroscope,
|
|
|
|
HTMLContentElement,
|
|
|
|
HTMLDialogElement,
|
|
|
|
HTMLShadowElement,
|
|
|
|
ImageCapture,
|
|
|
|
InputDeviceCapabilities,
|
|
|
|
InputDeviceInfo,
|
|
|
|
Keyboard,
|
|
|
|
KeyboardLayoutMap,
|
|
|
|
LinearAccelerationSensor,
|
|
|
|
Lock,
|
|
|
|
LockManager,
|
|
|
|
MediaMetadata,
|
|
|
|
MediaSession,
|
|
|
|
MediaSettingsRange,
|
|
|
|
MIDIAccess,
|
|
|
|
MIDIConnectionEvent,
|
|
|
|
MIDIInput,
|
|
|
|
MIDIInputMap,
|
|
|
|
MIDIMessageEvent,
|
|
|
|
MIDIOutput,
|
|
|
|
MIDIOutputMap,
|
|
|
|
MIDIPort,
|
|
|
|
NavigationPreloadManager,
|
|
|
|
NetworkInformation,
|
|
|
|
offscreenBuffering,
|
|
|
|
OffscreenCanvas,
|
|
|
|
OffscreenCanvasRenderingContext2D,
|
|
|
|
onbeforeinstallprompt,
|
|
|
|
oncancel,
|
|
|
|
ondeviceorientationabsolute,
|
|
|
|
onmousewheel,
|
|
|
|
onsearch,
|
|
|
|
onselectionchange,
|
|
|
|
openDatabase,
|
|
|
|
OrientationSensor,
|
|
|
|
OverconstrainedError,
|
|
|
|
PasswordCredential,
|
|
|
|
PaymentAddress,
|
|
|
|
PaymentInstruments,
|
|
|
|
PaymentManager,
|
|
|
|
PaymentMethodChangeEvent,
|
|
|
|
PaymentRequest,
|
|
|
|
PaymentRequestUpdateEvent,
|
|
|
|
PaymentResponse,
|
|
|
|
PerformanceEventTiming,
|
|
|
|
PerformanceLongTaskTiming,
|
|
|
|
PerformancePaintTiming,
|
|
|
|
PhotoCapabilities,
|
|
|
|
PictureInPictureWindow,
|
|
|
|
Presentation,
|
|
|
|
PresentationAvailability,
|
|
|
|
PresentationConnection,
|
|
|
|
PresentationConnectionAvailableEvent,
|
|
|
|
PresentationConnectionCloseEvent,
|
|
|
|
PresentationConnectionList,
|
|
|
|
PresentationReceiver,
|
|
|
|
PresentationRequest,
|
|
|
|
RelativeOrientationSensor,
|
|
|
|
RemotePlayback,
|
|
|
|
ReportingObserver,
|
|
|
|
RTCDtlsTransport,
|
|
|
|
RTCError,
|
|
|
|
RTCErrorEvent,
|
|
|
|
RTCIceTransport,
|
|
|
|
RTCSctpTransport,
|
|
|
|
Sensor,
|
|
|
|
SensorErrorEvent,
|
2020-01-22 16:03:41 +03:00
|
|
|
SharedArrayBuffer,
|
2019-10-29 19:20:49 +03:00
|
|
|
styleMedia,
|
|
|
|
StylePropertyMap,
|
|
|
|
StylePropertyMapReadOnly,
|
|
|
|
SVGDiscardElement,
|
|
|
|
SyncManager,
|
|
|
|
TaskAttributionTiming,
|
|
|
|
TextDecoderStream,
|
|
|
|
TextEncoderStream,
|
|
|
|
TextEvent,
|
|
|
|
Touch,
|
|
|
|
TouchEvent,
|
|
|
|
TouchList,
|
|
|
|
TransformStream,
|
|
|
|
USB,
|
|
|
|
USBAlternateInterface,
|
|
|
|
USBConfiguration,
|
|
|
|
USBConnectionEvent,
|
|
|
|
USBDevice,
|
|
|
|
USBEndpoint,
|
|
|
|
USBInterface,
|
|
|
|
USBInTransferResult,
|
|
|
|
USBIsochronousInTransferPacket,
|
|
|
|
USBIsochronousInTransferResult,
|
|
|
|
USBIsochronousOutTransferPacket,
|
|
|
|
USBIsochronousOutTransferResult,
|
|
|
|
USBOutTransferResult,
|
|
|
|
UserActivation,
|
|
|
|
visualViewport,
|
|
|
|
webkitCancelAnimationFrame,
|
|
|
|
webkitMediaStream,
|
|
|
|
WebKitMutationObserver,
|
|
|
|
webkitRequestAnimationFrame,
|
|
|
|
webkitRequestFileSystem,
|
|
|
|
webkitResolveLocalFileSystemURL,
|
|
|
|
webkitRTCPeerConnection,
|
|
|
|
webkitSpeechGrammar,
|
|
|
|
webkitSpeechGrammarList,
|
|
|
|
webkitSpeechRecognition,
|
|
|
|
webkitSpeechRecognitionError,
|
|
|
|
webkitSpeechRecognitionEvent,
|
|
|
|
webkitStorageInfo,
|
|
|
|
Worklet,
|
|
|
|
WritableStream)]
|
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,
|
2019-01-02 16:29:18 +03:00
|
|
|
CrossOriginReadable] readonly attribute WindowProxy window;
|
2015-04-27 20:38:12 +03:00
|
|
|
[Replaceable, Constant, StoreInSlot,
|
2019-01-02 16:29:18 +03:00
|
|
|
CrossOriginReadable] readonly attribute WindowProxy 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;
|
2019-01-02 16:29:18 +03:00
|
|
|
[PutForwards=href, Unforgeable, 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;
|
2019-01-02 16:29:18 +03:00
|
|
|
[Throws, CrossOriginCallable, NeedsCallerType] 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();
|
2020-01-16 17:38:40 +03:00
|
|
|
[Throws, CrossOriginCallable, NeedsCallerType] 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 = "");
|
2019-07-11 19:31:34 +03:00
|
|
|
[Throws] WindowProxy? open(optional USVString url = "", optional DOMString target = "", optional [TreatNullAs=EmptyString] 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
|
2019-10-21 12:35:19 +03:00
|
|
|
[Throws, SecureContext, Pref="browser.cache.offline.enable"] 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 = "");
|
2019-08-03 05:17:00 +03:00
|
|
|
[Throws, Pref="dom.enable_window_print"]
|
2017-11-13 18:38:50 +03:00
|
|
|
void print();
|
2013-10-08 19:51:42 +04:00
|
|
|
|
2019-08-28 20:51:37 +03:00
|
|
|
[Throws, CrossOriginCallable, NeedsSubjectPrincipal,
|
|
|
|
BinaryName="postMessageMoz"]
|
2017-02-03 13:00:38 +03:00
|
|
|
void postMessage(any message, DOMString targetOrigin, optional sequence<object> transfer = []);
|
2019-08-28 20:51:37 +03:00
|
|
|
[Throws, CrossOriginCallable, NeedsSubjectPrincipal,
|
|
|
|
BinaryName="postMessageMoz"]
|
2019-07-03 10:52:35 +03:00
|
|
|
void postMessage(any message, optional WindowPostMessageOptions options = {});
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// also has obsolete members
|
|
|
|
};
|
2019-09-06 22:34:55 +03:00
|
|
|
Window includes GlobalEventHandlers;
|
2019-09-24 18:22:26 +03:00
|
|
|
Window includes WindowEventHandlers;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
2019-09-24 18:22:26 +03:00
|
|
|
interface mixin WindowSessionStorage {
|
2013-10-08 19:51:42 +04:00
|
|
|
//[Throws] readonly attribute Storage sessionStorage;
|
|
|
|
[Throws] readonly attribute Storage? sessionStorage;
|
|
|
|
};
|
2019-09-24 18:22:26 +03:00
|
|
|
Window includes WindowSessionStorage;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
2019-09-24 18:22:26 +03:00
|
|
|
interface mixin WindowLocalStorage {
|
2016-10-11 04:07:48 +03:00
|
|
|
[Throws] readonly attribute Storage? localStorage;
|
2013-10-08 19:51:42 +04:00
|
|
|
};
|
2019-09-24 18:22:26 +03:00
|
|
|
Window includes WindowLocalStorage;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
// 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);
|
2019-07-03 10:52:35 +03:00
|
|
|
void scroll(optional ScrollToOptions options = {});
|
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 scrollTo(unrestricted double x, unrestricted double y);
|
2019-07-03 10:52:35 +03:00
|
|
|
void scrollTo(optional ScrollToOptions options = {});
|
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 scrollBy(unrestricted double x, unrestricted double y);
|
2019-07-03 10:52:35 +03:00
|
|
|
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
|
2019-09-24 18:22:26 +03:00
|
|
|
Window includes GlobalCrypto;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
2016-02-09 18:43:00 +03:00
|
|
|
// https://fidoalliance.org/specifications/download/
|
2019-09-24 18:22:26 +03:00
|
|
|
Window includes GlobalU2F;
|
2016-02-09 18:43:00 +03:00
|
|
|
|
2013-10-08 19:51:42 +04:00
|
|
|
#ifdef MOZ_WEBSPEECH
|
|
|
|
// http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
|
2019-09-24 18:22:26 +03:00
|
|
|
interface mixin SpeechSynthesisGetter {
|
2013-10-08 19:51:42 +04:00
|
|
|
[Throws, Pref="media.webspeech.synth.enabled"] readonly attribute SpeechSynthesis speechSynthesis;
|
|
|
|
};
|
|
|
|
|
2019-09-24 18:22:26 +03:00
|
|
|
Window includes SpeechSynthesisGetter;
|
2013-10-08 19:51:42 +04:00
|
|
|
#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.
|
|
|
|
*/
|
2019-07-03 10:52:35 +03: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.
|
|
|
|
*/
|
2019-07-03 10:52:35 +03: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;
|
|
|
|
|
2020-06-17 20:17:01 +03:00
|
|
|
[ChromeOnly, Constant, CrossOriginReadable, BinaryName="getBrowsingContext"]
|
|
|
|
readonly attribute BrowsingContext browsingContext;
|
|
|
|
|
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.
|
2019-10-29 13:25:53 +03:00
|
|
|
*
|
|
|
|
* If you need this for tests use nsIDOMWindowUtils.paintCount instead.
|
2013-10-08 19:51:42 +04:00
|
|
|
*/
|
2019-10-29 13:25:53 +03:00
|
|
|
[Throws, Pref="dom.mozPaintCount.enabled"] readonly attribute unsigned long long mozPaintCount;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
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
|
2019-11-05 07:52:53 +03:00
|
|
|
* nsPIDOMWindow::OpenDialog() that takes 3 optional
|
2013-10-08 19:51:42 +04:00
|
|
|
* 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
|
|
|
|
2020-04-22 16:08:25 +03:00
|
|
|
[Func="nsGlobalWindowInner::ContentPropertyEnabled",
|
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
|
|
|
|
2020-01-22 00:32:28 +03:00
|
|
|
[Pure, ChromeOnly]
|
|
|
|
readonly attribute WindowGlobalChild? windowGlobalChild;
|
2013-10-08 19:51:42 +04:00
|
|
|
};
|
|
|
|
|
2019-09-24 18:22:26 +03:00
|
|
|
Window includes TouchEventHandlers;
|
2013-10-08 19:51:42 +04:00
|
|
|
|
2019-09-24 18:22:26 +03:00
|
|
|
Window includes 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
|
2020-05-22 14:41:15 +03:00
|
|
|
// Sidebar is deprecated and it will be removed in the next cycles. See bug 1640138.
|
2014-03-28 08:03:03 +04:00
|
|
|
partial interface Window {
|
2020-05-22 14:41:15 +03:00
|
|
|
[Replaceable, Throws, UseCounter]
|
2014-03-28 08:03:03 +04:00
|
|
|
readonly attribute (External or WindowProxy) sidebar;
|
|
|
|
};
|
|
|
|
#endif
|
2014-02-28 03:39:00 +04:00
|
|
|
|
2019-03-19 15:59:54 +03:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
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"]
|
2020-01-26 23:17:41 +03:00
|
|
|
void setCursor(UTF8String cursor);
|
2014-02-06 08:37:30 +04:00
|
|
|
|
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();
|
2020-03-02 16:36:39 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2020-04-07 14:01:47 +03:00
|
|
|
DOMString getWorkspaceID();
|
2020-03-02 16:36:39 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2020-04-07 14:01:47 +03:00
|
|
|
void moveToWorkspace(DOMString workspaceID);
|
2014-02-06 08:37:30 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
2018-02-12 04:14:49 +03:00
|
|
|
/**
|
|
|
|
* Calls the given function as soon as a style or layout flush for the
|
2019-01-16 22:59:55 +03:00
|
|
|
* top-level document is not necessary, and returns a Promise which
|
|
|
|
* resolves to the callback's return value after it executes.
|
2018-02-12 04:14:49 +03:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
2019-01-28 09:50:25 +03:00
|
|
|
* The callback _must not modify the DOM for any window in any way_. If it
|
|
|
|
* does, after finishing executing, the Promise returned by
|
|
|
|
* promiseDocumentFlushed will reject with
|
|
|
|
* NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR.
|
|
|
|
*
|
2018-02-12 04:14:49 +03:00
|
|
|
* 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.
|
|
|
|
*
|
2019-01-16 00:38:31 +03:00
|
|
|
* Using window.top.promiseDocumentFlushed in combination with a callback
|
|
|
|
* that is querying items in a window that might be swapped out via
|
|
|
|
* nsFrameLoader::SwapWithOtherLoader is highly discouraged. For example:
|
|
|
|
*
|
|
|
|
* let result = await window.top.promiseDocumentFlushed(() => {
|
|
|
|
* return window.document.body.getBoundingClientRect();
|
|
|
|
* });
|
|
|
|
*
|
|
|
|
* If "window" might get swapped out via nsFrameLoader::SwapWithOtherLoader
|
|
|
|
* at any time, then the callback might get called when the new host window
|
|
|
|
* will still incur layout flushes, since it's only the original host window
|
|
|
|
* that's being monitored via window.top.promiseDocumentFlushed.
|
|
|
|
*
|
|
|
|
* See bug 1519407 for further details.
|
|
|
|
*
|
2018-02-12 04:14:49 +03:00
|
|
|
* 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);
|
|
|
|
|
2020-02-05 00:28:57 +03:00
|
|
|
[ChromeOnly]
|
2017-10-06 14:47:27 +03:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2019-09-24 18:22:26 +03:00
|
|
|
Window includes 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,
|
2019-07-03 10:52:35 +03:00
|
|
|
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"]
|
|
|
|
*/
|
2020-02-05 00:28:57 +03:00
|
|
|
[Func="IsChromeOrUAWidget"]
|
2017-07-15 02:47:23 +03:00
|
|
|
sequence<DOMString> getRegionalPrefsLocales();
|
2017-03-04 05:30:00 +03:00
|
|
|
|
2019-03-29 13:49:58 +03:00
|
|
|
/**
|
|
|
|
* Returns a list of locales that the web content would know from the user.
|
|
|
|
*
|
|
|
|
* One of the fingerprinting technique is to recognize users from their locales
|
|
|
|
* exposed to web content. For those components that would be fingerprintable
|
|
|
|
* from the locale should call this API instead of |getRegionalPrefsLocales()|.
|
|
|
|
*
|
|
|
|
* If the pref is set to spoof locale setting, this function will return the
|
|
|
|
* spoofed locale, otherwise it returns what |getRegionalPrefsLocales()| returns.
|
|
|
|
*
|
|
|
|
* This API always returns at least one locale.
|
|
|
|
*
|
|
|
|
* Example: ["en-US"]
|
|
|
|
*/
|
2020-02-05 00:28:57 +03:00
|
|
|
[Func="IsChromeOrUAWidget"]
|
2019-03-29 13:49:58 +03:00
|
|
|
sequence<DOMString> getWebExposedLocales();
|
|
|
|
|
2017-03-04 05:30:00 +03:00
|
|
|
/**
|
|
|
|
* Getter funcion for IntlUtils, which provides helper functions for
|
|
|
|
* localization.
|
|
|
|
*/
|
2020-02-05 00:28:57 +03:00
|
|
|
[Throws, Func="IsChromeOrUAWidget"]
|
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
|
|
|
|
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 = "/";
|
|
|
|
};
|