2018-09-13 20:04:55 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2013-04-25 15:13:21 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is:
|
2013-10-08 15:51:42 +00: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 15:13:21 +00:00
|
|
|
* https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html
|
2013-10-08 15:51:42 +00: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 10:13:09 +00:00
|
|
|
* https://w3c.github.io/webappsec-secure-contexts/#monkey-patching-global-object
|
2016-08-22 12:52:45 +00:00
|
|
|
* https://w3c.github.io/requestidlecallback/
|
2016-12-16 21:21:51 +00:00
|
|
|
* https://drafts.css-houdini.org/css-paint-api-1/#dom-window-paintworklet
|
2018-08-20 20:28:42 +00:00
|
|
|
* https://wicg.github.io/visual-viewport/#the-visualviewport-interface
|
2013-04-25 15:13:21 +00:00
|
|
|
*/
|
|
|
|
|
2014-02-06 04:37:30 +00:00
|
|
|
interface nsIBrowserDOMWindow;
|
2017-05-18 07:07:25 +00:00
|
|
|
interface XULControllers;
|
2018-07-24 23:47:40 +00:00
|
|
|
interface nsIDOMWindowUtils;
|
2013-10-08 15:51:42 +00:00
|
|
|
|
2018-07-13 22:42:07 +00:00
|
|
|
typedef OfflineResourceList ApplicationCache;
|
|
|
|
|
2013-10-08 15:51:42 +00:00
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
2019-09-27 15:26:14 +00:00
|
|
|
[Global, LegacyUnenumerableNamedProperties, NeedResolve,
|
2019-10-29 16:20:49 +00: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 13:03:41 +00:00
|
|
|
SharedArrayBuffer,
|
2019-10-29 16:20:49 +00: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 15:51:42 +00:00
|
|
|
/*sealed*/ interface Window : EventTarget {
|
|
|
|
// the current browsing context
|
2014-12-09 19:44:37 +00:00
|
|
|
[Unforgeable, Constant, StoreInSlot,
|
2019-01-02 13:29:18 +00:00
|
|
|
CrossOriginReadable] readonly attribute WindowProxy window;
|
2015-04-27 17:38:12 +00:00
|
|
|
[Replaceable, Constant, StoreInSlot,
|
2019-01-02 13:29:18 +00:00
|
|
|
CrossOriginReadable] readonly attribute WindowProxy self;
|
2014-09-05 18:28:45 +00:00
|
|
|
[Unforgeable, StoreInSlot, Pure] readonly attribute Document? document;
|
2015-09-28 18:25:04 +00:00
|
|
|
[Throws] attribute DOMString name;
|
2019-01-02 13:29:18 +00:00
|
|
|
[PutForwards=href, Unforgeable, CrossOriginReadable,
|
|
|
|
CrossOriginWritable] readonly attribute Location location;
|
2013-10-08 15:51:42 +00:00
|
|
|
[Throws] readonly attribute History history;
|
2016-10-12 07:26:02 +00:00
|
|
|
readonly attribute CustomElementRegistry customElements;
|
2013-10-08 15:51:42 +00: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 13:29:18 +00:00
|
|
|
[Throws, CrossOriginCallable, NeedsCallerType] void close();
|
2013-12-09 15:34:03 +00:00
|
|
|
[Throws, CrossOriginReadable] readonly attribute boolean closed;
|
2013-10-08 15:51:42 +00:00
|
|
|
[Throws] void stop();
|
2020-01-16 14:38:40 +00:00
|
|
|
[Throws, CrossOriginCallable, NeedsCallerType] void focus();
|
2013-12-09 15:34:03 +00:00
|
|
|
[Throws, CrossOriginCallable] void blur();
|
2018-09-25 15:55:09 +00:00
|
|
|
[Replaceable, Pref="dom.window.event.enabled"] readonly attribute any event;
|
2013-10-08 15:51:42 +00:00
|
|
|
|
|
|
|
// other browsing contexts
|
2013-12-09 15:34:03 +00:00
|
|
|
[Replaceable, Throws, CrossOriginReadable] readonly attribute WindowProxy frames;
|
2018-12-18 20:06:19 +00:00
|
|
|
[Replaceable, CrossOriginReadable] readonly attribute unsigned long length;
|
2014-05-22 18:43:11 +00:00
|
|
|
//[Unforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy top;
|
2018-12-18 20:06:19 +00:00
|
|
|
[Unforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy? top;
|
|
|
|
[Throws, CrossOriginReadable] attribute any opener;
|
2013-10-08 15:51:42 +00:00
|
|
|
//[Throws] readonly attribute WindowProxy parent;
|
2018-12-18 20:06:19 +00:00
|
|
|
[Replaceable, Throws, CrossOriginReadable] readonly attribute WindowProxy? parent;
|
2016-09-29 14:14:42 +00:00
|
|
|
[Throws, NeedsSubjectPrincipal] readonly attribute Element? frameElement;
|
2016-10-20 20:52:38 +00:00
|
|
|
//[Throws] WindowProxy? open(optional USVString url = "about:blank", optional DOMString target = "_blank", [TreatNullAs=EmptyString] optional DOMString features = "");
|
2019-07-11 16:31:34 +00:00
|
|
|
[Throws] WindowProxy? open(optional USVString url = "", optional DOMString target = "", optional [TreatNullAs=EmptyString] DOMString features = "");
|
2014-09-05 20:36:32 +00:00
|
|
|
getter object (DOMString name);
|
2013-10-08 15:51:42 +00:00
|
|
|
|
|
|
|
// the user agent
|
2017-04-14 02:40:03 +00:00
|
|
|
readonly attribute Navigator navigator;
|
2014-03-28 04:03:03 +00:00
|
|
|
#ifdef HAVE_SIDEBAR
|
|
|
|
[Replaceable, Throws] readonly attribute External external;
|
|
|
|
#endif
|
2019-10-21 09:35:19 +00:00
|
|
|
[Throws, SecureContext, Pref="browser.cache.offline.enable"] readonly attribute ApplicationCache applicationCache;
|
2013-10-08 15:51:42 +00:00
|
|
|
|
|
|
|
// user prompts
|
2017-12-14 22:03:14 +00: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 02:17:00 +00:00
|
|
|
[Throws, Pref="dom.enable_window_print"]
|
2017-11-13 15:38:50 +00:00
|
|
|
void print();
|
2013-10-08 15:51:42 +00:00
|
|
|
|
2019-08-28 17:51:37 +00:00
|
|
|
[Throws, CrossOriginCallable, NeedsSubjectPrincipal,
|
|
|
|
BinaryName="postMessageMoz"]
|
2017-02-03 10:00:38 +00:00
|
|
|
void postMessage(any message, DOMString targetOrigin, optional sequence<object> transfer = []);
|
2019-08-28 17:51:37 +00:00
|
|
|
[Throws, CrossOriginCallable, NeedsSubjectPrincipal,
|
|
|
|
BinaryName="postMessageMoz"]
|
2019-07-03 07:52:35 +00:00
|
|
|
void postMessage(any message, optional WindowPostMessageOptions options = {});
|
2013-10-08 15:51:42 +00:00
|
|
|
|
|
|
|
// also has obsolete members
|
|
|
|
};
|
2019-09-06 19:34:55 +00:00
|
|
|
Window includes GlobalEventHandlers;
|
2019-09-24 15:22:26 +00:00
|
|
|
Window includes WindowEventHandlers;
|
2013-10-08 15:51:42 +00:00
|
|
|
|
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
2019-09-24 15:22:26 +00:00
|
|
|
interface mixin WindowSessionStorage {
|
2013-10-08 15:51:42 +00:00
|
|
|
//[Throws] readonly attribute Storage sessionStorage;
|
|
|
|
[Throws] readonly attribute Storage? sessionStorage;
|
|
|
|
};
|
2019-09-24 15:22:26 +00:00
|
|
|
Window includes WindowSessionStorage;
|
2013-10-08 15:51:42 +00:00
|
|
|
|
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
2019-09-24 15:22:26 +00:00
|
|
|
interface mixin WindowLocalStorage {
|
2016-10-11 01:07:48 +00:00
|
|
|
[Throws] readonly attribute Storage? localStorage;
|
2013-10-08 15:51:42 +00:00
|
|
|
};
|
2019-09-24 15:22:26 +00:00
|
|
|
Window includes WindowLocalStorage;
|
2013-10-08 15:51:42 +00:00
|
|
|
|
|
|
|
// http://www.whatwg.org/specs/web-apps/current-work/
|
|
|
|
partial interface Window {
|
2014-02-09 08:04:39 +00:00
|
|
|
void captureEvents();
|
|
|
|
void releaseEvents();
|
2013-10-08 15:51:42 +00: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 17:47:56 +00:00
|
|
|
dictionary ScrollToOptions : ScrollOptions {
|
|
|
|
unrestricted double left;
|
|
|
|
unrestricted double top;
|
|
|
|
};
|
|
|
|
|
2013-10-08 15:51:42 +00:00
|
|
|
partial interface Window {
|
2017-10-19 14:06:50 +00:00
|
|
|
//[Throws, NewObject, NeedsCallerType] MediaQueryList matchMedia(DOMString query);
|
|
|
|
[Throws, NewObject, NeedsCallerType] MediaQueryList? matchMedia(DOMString query);
|
2015-04-09 02:50:45 +00: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 15:51:42 +00: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-14 22:03:14 +00: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 15:51:42 +00:00
|
|
|
|
|
|
|
// viewport
|
2015-04-09 02:50:45 +00: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 19:05:54 +00:00
|
|
|
[Throws, NeedsCallerType] attribute any innerWidth;
|
|
|
|
[Throws, NeedsCallerType] attribute any innerHeight;
|
2013-10-08 15:51:42 +00: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 17:47:56 +00:00
|
|
|
void scroll(unrestricted double x, unrestricted double y);
|
2019-07-03 07:52:35 +00: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 17:47:56 +00:00
|
|
|
void scrollTo(unrestricted double x, unrestricted double y);
|
2019-07-03 07:52:35 +00: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 17:47:56 +00:00
|
|
|
void scrollBy(unrestricted double x, unrestricted double y);
|
2019-07-03 07:52:35 +00:00
|
|
|
void scrollBy(optional ScrollToOptions options = {});
|
2015-02-20 00:03:07 +00: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 02:50:45 +00:00
|
|
|
// The four properties below are double per spec at the moment, but whether
|
|
|
|
// that will continue is unclear.
|
2017-03-02 21:01:31 +00: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 15:51:42 +00:00
|
|
|
|
2018-10-17 02:20:15 +00:00
|
|
|
// Aliases for screenX / screenY.
|
|
|
|
[Replaceable, Throws, NeedsCallerType] readonly attribute double screenLeft;
|
|
|
|
[Replaceable, Throws, NeedsCallerType] readonly attribute double screenTop;
|
|
|
|
|
2013-10-08 15:51:42 +00:00
|
|
|
// client
|
2015-04-09 02:50:45 +00: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 19:05:54 +00:00
|
|
|
[Throws, NeedsCallerType] attribute any screenX;
|
|
|
|
[Throws, NeedsCallerType] attribute any screenY;
|
|
|
|
[Throws, NeedsCallerType] attribute any outerWidth;
|
|
|
|
[Throws, NeedsCallerType] attribute any outerHeight;
|
2013-10-08 15:51:42 +00: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 15:13:21 +00:00
|
|
|
callback FrameRequestCallback = void (DOMHighResTimeStamp time);
|
2013-10-08 15:51:15 +00:00
|
|
|
|
2013-10-08 15:51:42 +00:00
|
|
|
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html
|
|
|
|
partial interface Window {
|
2014-09-06 02:42:33 +00:00
|
|
|
[Replaceable, Pure, StoreInSlot] readonly attribute Performance? performance;
|
2013-10-08 15:51:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html
|
2019-09-24 15:22:26 +00:00
|
|
|
Window includes GlobalCrypto;
|
2013-10-08 15:51:42 +00:00
|
|
|
|
2016-02-09 15:43:00 +00:00
|
|
|
// https://fidoalliance.org/specifications/download/
|
2019-09-24 15:22:26 +00:00
|
|
|
Window includes GlobalU2F;
|
2016-02-09 15:43:00 +00:00
|
|
|
|
2013-10-08 15:51:42 +00:00
|
|
|
#ifdef MOZ_WEBSPEECH
|
|
|
|
// http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
|
2019-09-24 15:22:26 +00:00
|
|
|
interface mixin SpeechSynthesisGetter {
|
2013-10-08 15:51:42 +00:00
|
|
|
[Throws, Pref="media.webspeech.synth.enabled"] readonly attribute SpeechSynthesis speechSynthesis;
|
|
|
|
};
|
|
|
|
|
2019-09-24 15:22:26 +00:00
|
|
|
Window includes SpeechSynthesisGetter;
|
2013-10-08 15:51:42 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Mozilla-specific stuff
|
|
|
|
partial interface Window {
|
2017-05-19 04:57:35 +00:00
|
|
|
//[NewObject, Throws] CSSStyleDeclaration getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
|
|
|
|
[NewObject, Throws] CSSStyleDeclaration? getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
|
|
|
|
|
2013-10-08 15:51:42 +00:00
|
|
|
// Mozilla extensions
|
|
|
|
/**
|
|
|
|
* Method for scrolling this window by a number of lines.
|
|
|
|
*/
|
2019-07-03 07:52:35 +00:00
|
|
|
void scrollByLines(long numLines, optional ScrollOptions options = {});
|
2013-10-08 15:51:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Method for scrolling this window by a number of pages.
|
|
|
|
*/
|
2019-07-03 07:52:35 +00:00
|
|
|
void scrollByPages(long numPages, optional ScrollOptions options = {});
|
2013-10-08 15:51:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Method for sizing this window to the content in the window.
|
|
|
|
*/
|
2017-12-14 22:03:14 +00:00
|
|
|
[Throws, NeedsCallerType] void sizeToContent();
|
2013-10-08 15:51:42 +00:00
|
|
|
|
|
|
|
// XXX Shouldn't this be in nsIDOMChromeWindow?
|
2017-05-18 07:07:25 +00:00
|
|
|
[ChromeOnly, Replaceable, Throws] readonly attribute XULControllers controllers;
|
2013-10-08 15:51:42 +00:00
|
|
|
|
2014-06-04 18:11:05 +00:00
|
|
|
[ChromeOnly, Throws] readonly attribute Element? realFrameElement;
|
|
|
|
|
2018-05-21 23:58:23 +00:00
|
|
|
[ChromeOnly] readonly attribute nsIDocShell? docShell;
|
|
|
|
|
2020-06-17 17:17:01 +00:00
|
|
|
[ChromeOnly, Constant, CrossOriginReadable, BinaryName="getBrowsingContext"]
|
|
|
|
readonly attribute BrowsingContext browsingContext;
|
|
|
|
|
2016-12-22 19:05:54 +00:00
|
|
|
[Throws, NeedsCallerType]
|
|
|
|
readonly attribute float mozInnerScreenX;
|
|
|
|
[Throws, NeedsCallerType]
|
|
|
|
readonly attribute float mozInnerScreenY;
|
2016-12-22 19:05:54 +00:00
|
|
|
[Replaceable, Throws, NeedsCallerType]
|
2017-09-25 18:53:09 +00:00
|
|
|
readonly attribute double devicePixelRatio;
|
2013-10-08 15:51:42 +00: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 04:38:02 +00:00
|
|
|
[ChromeOnly, Throws] readonly attribute long scrollMinX;
|
|
|
|
[ChromeOnly, Throws] readonly attribute long scrollMinY;
|
2013-10-08 15:51:42 +00:00
|
|
|
[Replaceable, Throws] readonly attribute long scrollMaxX;
|
|
|
|
[Replaceable, Throws] readonly attribute long scrollMaxY;
|
|
|
|
|
2017-12-14 22:03:14 +00:00
|
|
|
[Throws] attribute boolean fullScreen;
|
2013-10-08 15:51:42 +00:00
|
|
|
|
|
|
|
// XXX Should this be in nsIDOMChromeWindow?
|
2014-07-27 23:21:00 +00:00
|
|
|
void updateCommands(DOMString action,
|
|
|
|
optional Selection? sel = null,
|
|
|
|
optional short reason = 0);
|
2013-10-08 15:51:42 +00: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-14 22:03:14 +00: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 15:51:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the number of times this document for this window has
|
|
|
|
* been painted to the screen.
|
2019-10-29 10:25:53 +00:00
|
|
|
*
|
|
|
|
* If you need this for tests use nsIDOMWindowUtils.paintCount instead.
|
2013-10-08 15:51:42 +00:00
|
|
|
*/
|
2019-10-29 10:25:53 +00:00
|
|
|
[Throws, Pref="dom.mozPaintCount.enabled"] readonly attribute unsigned long long mozPaintCount;
|
2013-10-08 15:51:42 +00:00
|
|
|
|
|
|
|
attribute EventHandler ondevicemotion;
|
|
|
|
attribute EventHandler ondeviceorientation;
|
2015-12-17 22:14:51 +00:00
|
|
|
attribute EventHandler onabsolutedeviceorientation;
|
2013-10-08 15:51:42 +00: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 04:52:53 +00:00
|
|
|
* nsPIDOMWindow::OpenDialog() that takes 3 optional
|
2013-10-08 15:51:42 +00:00
|
|
|
* arguments, plus any additional arguments are passed on as
|
|
|
|
* arguments on the dialog's window object (window.arguments).
|
|
|
|
*/
|
2017-12-14 22:03:14 +00:00
|
|
|
[Throws, ChromeOnly] WindowProxy? openDialog(optional DOMString url = "",
|
|
|
|
optional DOMString name = "",
|
|
|
|
optional DOMString options = "",
|
|
|
|
any... extraArguments);
|
2013-10-08 15:51:42 +00:00
|
|
|
|
2020-04-22 13:08:25 +00:00
|
|
|
[Func="nsGlobalWindowInner::ContentPropertyEnabled",
|
2017-09-19 01:24:38 +00:00
|
|
|
NonEnumerable, Replaceable, Throws, NeedsCallerType]
|
|
|
|
readonly attribute object? content;
|
2013-12-09 15:34:04 +00:00
|
|
|
|
2018-07-18 04:30:38 +00:00
|
|
|
[Throws, ChromeOnly] any getInterface(any iid);
|
2015-04-17 20:17:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Same as nsIDOMWindow.windowRoot, useful for event listener targeting.
|
|
|
|
*/
|
|
|
|
[ChromeOnly, Throws]
|
|
|
|
readonly attribute WindowRoot? windowRoot;
|
2017-12-19 15:04:47 +00: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 03:18:51 +00: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-24 23:47:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the nsIDOMWindowUtils for this window.
|
|
|
|
*/
|
|
|
|
[Constant, Throws, ChromeOnly]
|
|
|
|
readonly attribute nsIDOMWindowUtils windowUtils;
|
2018-11-19 18:56:18 +00:00
|
|
|
|
2020-01-21 21:32:28 +00:00
|
|
|
[Pure, ChromeOnly]
|
|
|
|
readonly attribute WindowGlobalChild? windowGlobalChild;
|
2013-10-08 15:51:42 +00:00
|
|
|
};
|
|
|
|
|
2019-09-24 15:22:26 +00:00
|
|
|
Window includes TouchEventHandlers;
|
2013-10-08 15:51:42 +00:00
|
|
|
|
2019-09-24 15:22:26 +00:00
|
|
|
Window includes OnErrorEventHandlerForWindow;
|
2014-02-06 04:36:57 +00:00
|
|
|
|
2017-08-12 00:42:11 +00:00
|
|
|
#if defined(MOZ_WIDGET_ANDROID)
|
2015-10-24 04:37:28 +00:00
|
|
|
// https://compat.spec.whatwg.org/#windoworientation-interface
|
|
|
|
partial interface Window {
|
2016-12-22 19:05:54 +00:00
|
|
|
[NeedsCallerType]
|
2015-10-24 04:37:28 +00:00
|
|
|
readonly attribute short orientation;
|
|
|
|
attribute EventHandler onorientationchange;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2014-03-28 04:03:03 +00:00
|
|
|
#ifdef HAVE_SIDEBAR
|
|
|
|
// Mozilla extension
|
2020-05-22 11:41:15 +00:00
|
|
|
// Sidebar is deprecated and it will be removed in the next cycles. See bug 1640138.
|
2014-03-28 04:03:03 +00:00
|
|
|
partial interface Window {
|
2020-05-22 11:41:15 +00:00
|
|
|
[Replaceable, Throws, UseCounter]
|
2014-03-28 04:03:03 +00:00
|
|
|
readonly attribute (External or WindowProxy) sidebar;
|
|
|
|
};
|
|
|
|
#endif
|
2014-02-27 23:39:00 +00:00
|
|
|
|
2019-03-19 12:59:54 +00:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2018-02-12 01:14:49 +00:00
|
|
|
callback PromiseDocumentFlushedCallback = any ();
|
|
|
|
|
2017-07-05 21:01:04 +00:00
|
|
|
// Mozilla extensions for Chrome windows.
|
|
|
|
partial interface Window {
|
2017-09-19 14:13:22 +00:00
|
|
|
// The STATE_* constants need to match the corresponding enum in nsGlobalWindow.cpp.
|
2017-11-09 20:44:10 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 04:37:30 +00:00
|
|
|
const unsigned short STATE_MAXIMIZED = 1;
|
2017-11-09 20:44:10 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 04:37:30 +00:00
|
|
|
const unsigned short STATE_MINIMIZED = 2;
|
2017-11-09 20:44:10 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 04:37:30 +00:00
|
|
|
const unsigned short STATE_NORMAL = 3;
|
2017-11-09 20:44:10 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 04:37:30 +00:00
|
|
|
const unsigned short STATE_FULLSCREEN = 4;
|
|
|
|
|
2017-11-09 20:44:10 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 04:37:30 +00:00
|
|
|
readonly attribute unsigned short windowState;
|
|
|
|
|
2017-11-09 20:44:10 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2017-05-26 10:14:06 +00:00
|
|
|
readonly attribute boolean isFullyOccluded;
|
|
|
|
|
2014-02-06 04:37:30 +00: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 20:44:10 +00:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 04:37:30 +00:00
|
|
|
attribute nsIBrowserDOMWindow? browserDOMWindow;
|
|
|
|
|
2017-11-09 20:44:10 +00:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 04:37:30 +00:00
|
|
|
void getAttention();
|
|
|
|
|
2017-11-09 20:44:10 +00:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 04:37:30 +00:00
|
|
|
void getAttentionWithCycleCount(long aCycleCount);
|
|
|
|
|
2017-11-09 20:44:10 +00:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2020-01-26 20:17:41 +00:00
|
|
|
void setCursor(UTF8String cursor);
|
2014-02-06 04:37:30 +00:00
|
|
|
|
2017-12-14 22:03:14 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 04:37:30 +00:00
|
|
|
void maximize();
|
2017-12-14 22:03:14 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 04:37:30 +00:00
|
|
|
void minimize();
|
2017-12-14 22:03:14 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 04:37:30 +00:00
|
|
|
void restore();
|
2020-03-02 13:36:39 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2020-04-07 11:01:47 +00:00
|
|
|
DOMString getWorkspaceID();
|
2020-03-02 13:36:39 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2020-04-07 11:01:47 +00:00
|
|
|
void moveToWorkspace(DOMString workspaceID);
|
2014-02-06 04:37:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify a default button is loaded on a dialog or a wizard.
|
|
|
|
* defaultButton is the default button.
|
|
|
|
*/
|
2017-11-09 20:44:10 +00:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2014-02-06 04:37:30 +00:00
|
|
|
void notifyDefaultButtonLoaded(Element defaultButton);
|
|
|
|
|
2018-02-14 16:35:39 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2017-06-20 09:09:50 +00:00
|
|
|
readonly attribute ChromeMessageBroadcaster messageManager;
|
2014-02-06 04:37:30 +00:00
|
|
|
|
2014-05-23 12:51:56 +00:00
|
|
|
/**
|
|
|
|
* Returns the message manager identified by the given group name that
|
|
|
|
* manages all frame loaders belonging to that group.
|
|
|
|
*/
|
2018-02-14 16:35:39 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2017-06-20 09:09:50 +00:00
|
|
|
ChromeMessageBroadcaster getGroupMessageManager(DOMString aGroup);
|
2014-05-23 12:51:56 +00:00
|
|
|
|
2018-02-12 01:14:49 +00:00
|
|
|
/**
|
|
|
|
* Calls the given function as soon as a style or layout flush for the
|
2019-01-16 19:59:55 +00: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 01:14:49 +00: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 06:50:25 +00: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 01:14:49 +00: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-15 21:38:31 +00: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 01:14:49 +00: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-04 21:28:57 +00:00
|
|
|
[ChromeOnly]
|
2017-10-06 11:47:27 +00:00
|
|
|
readonly attribute boolean isChromeWindow;
|
|
|
|
};
|
|
|
|
|
2016-07-04 22:46:49 +00:00
|
|
|
partial interface Window {
|
|
|
|
[Pref="dom.vr.enabled"]
|
|
|
|
attribute EventHandler onvrdisplayconnect;
|
|
|
|
[Pref="dom.vr.enabled"]
|
|
|
|
attribute EventHandler onvrdisplaydisconnect;
|
|
|
|
[Pref="dom.vr.enabled"]
|
2016-10-18 22:18:10 +00:00
|
|
|
attribute EventHandler onvrdisplayactivate;
|
|
|
|
[Pref="dom.vr.enabled"]
|
|
|
|
attribute EventHandler onvrdisplaydeactivate;
|
|
|
|
[Pref="dom.vr.enabled"]
|
2016-07-04 22:46:49 +00:00
|
|
|
attribute EventHandler onvrdisplaypresentchange;
|
|
|
|
};
|
|
|
|
|
2016-12-16 21:21:51 +00:00
|
|
|
// https://drafts.css-houdini.org/css-paint-api-1/#dom-window-paintworklet
|
|
|
|
partial interface Window {
|
2017-03-05 07:20:38 +00:00
|
|
|
[Pref="dom.paintWorklet.enabled", Throws]
|
2016-12-16 21:21:51 +00:00
|
|
|
readonly attribute Worklet paintWorklet;
|
|
|
|
};
|
|
|
|
|
2019-09-24 15:22:26 +00:00
|
|
|
Window includes WindowOrWorkerGlobalScope;
|
2016-08-22 12:52:45 +00:00
|
|
|
|
|
|
|
partial interface Window {
|
2017-11-09 20:44:10 +00:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsRequestIdleCallbackEnabled"]
|
2016-08-22 12:52:45 +00:00
|
|
|
unsigned long requestIdleCallback(IdleRequestCallback callback,
|
2019-07-03 07:52:35 +00:00
|
|
|
optional IdleRequestOptions options = {});
|
2017-11-09 20:44:10 +00:00
|
|
|
[Func="nsGlobalWindowInner::IsRequestIdleCallbackEnabled"]
|
2016-08-22 12:52:45 +00:00
|
|
|
void cancelIdleCallback(unsigned long handle);
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary IdleRequestOptions {
|
|
|
|
unsigned long timeout;
|
|
|
|
};
|
|
|
|
|
|
|
|
callback IdleRequestCallback = void (IdleDeadline deadline);
|
2017-01-13 00:57:44 +00:00
|
|
|
|
2017-02-20 03:11:00 +00:00
|
|
|
partial interface Window {
|
2017-03-04 02:30:00 +00:00
|
|
|
/**
|
2017-07-14 23:47:23 +00: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 02:30:00 +00: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-04 21:28:57 +00:00
|
|
|
[Func="IsChromeOrUAWidget"]
|
2017-07-14 23:47:23 +00:00
|
|
|
sequence<DOMString> getRegionalPrefsLocales();
|
2017-03-04 02:30:00 +00:00
|
|
|
|
2019-03-29 10:49:58 +00: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-04 21:28:57 +00:00
|
|
|
[Func="IsChromeOrUAWidget"]
|
2019-03-29 10:49:58 +00:00
|
|
|
sequence<DOMString> getWebExposedLocales();
|
|
|
|
|
2017-03-04 02:30:00 +00:00
|
|
|
/**
|
|
|
|
* Getter funcion for IntlUtils, which provides helper functions for
|
|
|
|
* localization.
|
|
|
|
*/
|
2020-02-04 21:28:57 +00:00
|
|
|
[Throws, Func="IsChromeOrUAWidget"]
|
2017-03-04 02:30:00 +00:00
|
|
|
readonly attribute IntlUtils intlUtils;
|
2017-02-20 03:11:00 +00:00
|
|
|
};
|
2018-06-13 17:43:48 +00:00
|
|
|
|
2018-08-20 20:28:42 +00:00
|
|
|
partial interface Window {
|
|
|
|
[SameObject, Pref="dom.visualviewport.enabled", Replaceable]
|
|
|
|
readonly attribute VisualViewport visualViewport;
|
|
|
|
|
|
|
|
};
|
2018-10-29 15:26:30 +00:00
|
|
|
|
|
|
|
dictionary WindowPostMessageOptions : PostMessageOptions {
|
|
|
|
USVString targetOrigin = "/";
|
|
|
|
};
|