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
|
|
|
*/
|
|
|
|
|
2022-01-21 00:38:55 +03:00
|
|
|
interface Principal;
|
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;
|
Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
This centralizes our print and preview setup in nsGlobalWindowOuter so
that we never re-clone a clone, and so that we reuse the window.open()
codepath to create the browsing context to clone into.
For window.print, for both old print dialog / silent printing and new
print preview UI, we now create a hidden browser (as in with visibility:
collapse, which takes no space but still gets a layout box).
* In the modern UI case, this browser is swapped with the actual print
preview clone, and the UI takes care of removing the browser.
* In the print dialog / silent printing case, the printing code calls
window.close() from nsDocumentViewer::OnDonePrinting().
* We don't need to care about the old print preview UI for this case
because it can't be open from window.print().
We need to fall back to an actual window when there's no
nsIBrowserDOMWindow around for WPT print tests and the like, which don't
have one. That seems fine, we could special-case this code path more if
needed but it doesn't seem worth it.
Differential Revision: https://phabricator.services.mozilla.com/D87063
2020-08-25 20:45:12 +03:00
|
|
|
interface nsIPrintSettings;
|
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
|
2021-04-11 06:13:32 +03:00
|
|
|
[LegacyUnforgeable, 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;
|
2021-04-11 06:13:32 +03:00
|
|
|
[LegacyUnforgeable, StoreInSlot, Pure] readonly attribute Document? document;
|
2015-09-28 21:25:04 +03:00
|
|
|
[Throws] attribute DOMString name;
|
2021-04-11 06:13:32 +03:00
|
|
|
[PutForwards=href, LegacyUnforgeable, CrossOriginReadable,
|
2019-01-02 16:29:18 +03:00
|
|
|
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;
|
2022-09-21 10:44:58 +03:00
|
|
|
[Throws, CrossOriginCallable, NeedsCallerType] undefined close();
|
2013-12-09 19:34:03 +04:00
|
|
|
[Throws, CrossOriginReadable] readonly attribute boolean closed;
|
2022-09-21 10:44:58 +03:00
|
|
|
[Throws] undefined stop();
|
|
|
|
[Throws, CrossOriginCallable, NeedsCallerType] undefined focus();
|
|
|
|
[Throws, CrossOriginCallable, NeedsCallerType] undefined blur();
|
2022-09-28 22:10:51 +03:00
|
|
|
[Replaceable, Pref="dom.window.event.enabled"] readonly attribute (Event or undefined) 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;
|
2021-04-11 06:13:32 +03:00
|
|
|
[LegacyUnforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy? top;
|
2018-12-18 23:06:19 +03:00
|
|
|
[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 = "");
|
2021-04-11 06:13:32 +03:00
|
|
|
[Throws] WindowProxy? open(optional USVString url = "", optional DOMString target = "", optional [LegacyNullToEmptyString] 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;
|
2021-06-22 15:38:13 +03:00
|
|
|
[Pref="dom.window.clientinformation.enabled", BinaryName="Navigator"]
|
|
|
|
readonly attribute Navigator clientInformation;
|
|
|
|
|
2014-03-28 08:03:03 +04:00
|
|
|
[Replaceable, Throws] readonly attribute External external;
|
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
|
2022-09-21 10:44:58 +03:00
|
|
|
[Throws, NeedsSubjectPrincipal] undefined alert();
|
|
|
|
[Throws, NeedsSubjectPrincipal] undefined alert(DOMString message);
|
2017-12-15 01:03:14 +03:00
|
|
|
[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"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined print();
|
2013-10-08 19:51:42 +04:00
|
|
|
|
Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
This centralizes our print and preview setup in nsGlobalWindowOuter so
that we never re-clone a clone, and so that we reuse the window.open()
codepath to create the browsing context to clone into.
For window.print, for both old print dialog / silent printing and new
print preview UI, we now create a hidden browser (as in with visibility:
collapse, which takes no space but still gets a layout box).
* In the modern UI case, this browser is swapped with the actual print
preview clone, and the UI takes care of removing the browser.
* In the print dialog / silent printing case, the printing code calls
window.close() from nsDocumentViewer::OnDonePrinting().
* We don't need to care about the old print preview UI for this case
because it can't be open from window.print().
We need to fall back to an actual window when there's no
nsIBrowserDOMWindow around for WPT print tests and the like, which don't
have one. That seems fine, we could special-case this code path more if
needed but it doesn't seem worth it.
Differential Revision: https://phabricator.services.mozilla.com/D87063
2020-08-25 20:45:12 +03:00
|
|
|
// Returns a window that you can use for a print preview.
|
|
|
|
//
|
|
|
|
// This may reuse an existing window if this window is already a print
|
|
|
|
// preview document, or if you pass a docshell explicitly.
|
2020-08-27 23:18:11 +03:00
|
|
|
[Throws, Func="nsContentUtils::IsCallerChromeOrFuzzingEnabled"]
|
Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
This centralizes our print and preview setup in nsGlobalWindowOuter so
that we never re-clone a clone, and so that we reuse the window.open()
codepath to create the browsing context to clone into.
For window.print, for both old print dialog / silent printing and new
print preview UI, we now create a hidden browser (as in with visibility:
collapse, which takes no space but still gets a layout box).
* In the modern UI case, this browser is swapped with the actual print
preview clone, and the UI takes care of removing the browser.
* In the print dialog / silent printing case, the printing code calls
window.close() from nsDocumentViewer::OnDonePrinting().
* We don't need to care about the old print preview UI for this case
because it can't be open from window.print().
We need to fall back to an actual window when there's no
nsIBrowserDOMWindow around for WPT print tests and the like, which don't
have one. That seems fine, we could special-case this code path more if
needed but it doesn't seem worth it.
Differential Revision: https://phabricator.services.mozilla.com/D87063
2020-08-25 20:45:12 +03:00
|
|
|
WindowProxy? printPreview(optional nsIPrintSettings? settings = null,
|
|
|
|
optional nsIWebProgressListener? listener = null,
|
|
|
|
optional nsIDocShell? docShellToPreviewInto = null);
|
|
|
|
|
2019-08-28 20:51:37 +03:00
|
|
|
[Throws, CrossOriginCallable, NeedsSubjectPrincipal,
|
|
|
|
BinaryName="postMessageMoz"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined postMessage(any message, DOMString targetOrigin, optional sequence<object> transfer = []);
|
2019-08-28 20:51:37 +03:00
|
|
|
[Throws, CrossOriginCallable, NeedsSubjectPrincipal,
|
|
|
|
BinaryName="postMessageMoz"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined 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 {
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined captureEvents();
|
|
|
|
undefined 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();
|
|
|
|
};
|
|
|
|
|
2021-08-07 12:55:55 +03:00
|
|
|
// https://drafts.csswg.org/cssom/#extensions-to-the-window-interface
|
2013-10-08 19:51:42 +04:00
|
|
|
partial interface Window {
|
2021-08-07 12:55:55 +03:00
|
|
|
//[NewObject, Throws] CSSStyleDeclaration getComputedStyle(Element elt, optional DOMString? pseudoElt = "");
|
|
|
|
[NewObject, Throws] CSSStyleDeclaration? getComputedStyle(Element elt, optional DOMString? pseudoElt = "");
|
2013-10-08 19:51:42 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// 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);
|
2020-12-17 17:04:35 +03:00
|
|
|
[Throws, NewObject, NeedsCallerType] MediaQueryList? matchMedia(UTF8String 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
|
2022-09-21 10:44:58 +03:00
|
|
|
//[Throws] undefined moveTo(double x, double y);
|
|
|
|
//[Throws] undefined moveBy(double x, double y);
|
|
|
|
//[Throws] undefined resizeTo(double x, double y);
|
|
|
|
//[Throws] undefined resizeBy(double x, double y);
|
|
|
|
[Throws, NeedsCallerType] undefined moveTo(long x, long y);
|
|
|
|
[Throws, NeedsCallerType] undefined moveBy(long x, long y);
|
|
|
|
[Throws, NeedsCallerType] undefined resizeTo(long x, long y);
|
|
|
|
[Throws, NeedsCallerType] undefined 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
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined scroll(unrestricted double x, unrestricted double y);
|
|
|
|
undefined scroll(optional ScrollToOptions options = {});
|
|
|
|
undefined scrollTo(unrestricted double x, unrestricted double y);
|
|
|
|
undefined scrollTo(optional ScrollToOptions options = {});
|
|
|
|
undefined scrollBy(unrestricted double x, unrestricted double y);
|
|
|
|
undefined 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.
|
2022-09-21 10:44:58 +03:00
|
|
|
[ChromeOnly] undefined 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
|
|
|
};
|
|
|
|
|
2021-12-10 05:57:49 +03:00
|
|
|
// https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#animation-frames
|
|
|
|
Window includes AnimationFrameProvider;
|
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.
|
|
|
|
*/
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined scrollByLines(long numLines, optional ScrollOptions options = {});
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Method for scrolling this window by a number of pages.
|
|
|
|
*/
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined 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.
|
|
|
|
*/
|
2022-09-21 10:44:58 +03:00
|
|
|
[Throws, NeedsCallerType] undefined 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
|
|
|
|
2022-02-16 15:18:12 +03:00
|
|
|
// Allows chrome code to convert desktop pixels to device pixels and vice
|
|
|
|
// versa. Useful for interacting with the screen manager.
|
|
|
|
[ChromeOnly, Throws]
|
|
|
|
readonly attribute double desktopToDeviceScale;
|
|
|
|
|
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?
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined updateCommands(DOMString action,
|
2014-07-28 03:21:00 +04:00
|
|
|
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
|
|
|
|
|
|
|
attribute EventHandler ondevicemotion;
|
|
|
|
attribute EventHandler ondeviceorientation;
|
2015-12-18 01:14:51 +03:00
|
|
|
attribute EventHandler onabsolutedeviceorientation;
|
2021-03-30 23:44:47 +03:00
|
|
|
[Pref="device.sensors.proximity.enabled"]
|
|
|
|
attribute EventHandler onuserproximity;
|
2021-03-30 23:44:47 +03:00
|
|
|
[Pref="device.sensors.ambientLight.enabled"]
|
2013-10-08 19:51:42 +04:00
|
|
|
attribute EventHandler ondevicelight;
|
|
|
|
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined dump(DOMString str);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This method is here for backwards compatibility with 4.x only,
|
|
|
|
* its implementation is a no-op
|
|
|
|
*/
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined setResizable(boolean resizable);
|
2013-10-08 19:51:42 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2022-03-18 23:02:54 +03:00
|
|
|
[Replaceable, Deprecated="InstallTriggerDeprecated", Pref="extensions.InstallTrigger.enabled"]
|
2018-03-22 06:18:51 +03:00
|
|
|
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;
|
2022-01-21 00:38:55 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The principal of the client source of the window. This is supposed to be
|
|
|
|
* used for the service worker.
|
|
|
|
*
|
|
|
|
* This is used for APIs like https://w3c.github.io/push-api/ that extend
|
|
|
|
* ServiceWorkerRegistration and therefore need to operate consistently with
|
|
|
|
* ServiceWorkers and its Clients API. The client principal is the appropriate
|
|
|
|
* principal to pass to all nsIServiceWorkerManager APIs.
|
|
|
|
*
|
|
|
|
* Note that the client principal will be different from the node principal of
|
|
|
|
* the window's document if the window is in a third-party context when dFPI
|
|
|
|
* is enabled. In this case, the client principal will be the partitioned
|
|
|
|
* principal to support the service worker partitioning.
|
|
|
|
*/
|
|
|
|
[ChromeOnly]
|
|
|
|
readonly attribute Principal? clientPrincipal;
|
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
|
|
|
// 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 {
|
2021-06-22 19:05:45 +03:00
|
|
|
[Replaceable, Throws, UseCounter, Pref="dom.window.sidebar.enabled"]
|
2014-03-28 08:03:03 +04:00
|
|
|
readonly attribute (External or WindowProxy) sidebar;
|
|
|
|
};
|
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"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined getAttention();
|
2014-02-06 08:37:30 +04:00
|
|
|
|
2017-11-09 23:44:10 +03:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined getAttentionWithCycleCount(long aCycleCount);
|
2014-02-06 08:37:30 +04:00
|
|
|
|
2017-11-09 23:44:10 +03:00
|
|
|
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined setCursor(UTF8String cursor);
|
2014-02-06 08:37:30 +04:00
|
|
|
|
2017-12-15 01:03:14 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined maximize();
|
2017-12-15 01:03:14 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined minimize();
|
2017-12-15 01:03:14 +03:00
|
|
|
[Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined 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"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined 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"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined notifyDefaultButtonLoaded(Element defaultButton);
|
2014-02-06 08:37:30 +04:00
|
|
|
|
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}
|
|
|
|
*/
|
2022-05-02 10:44:24 +03:00
|
|
|
[NewObject, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
|
2018-02-12 04:14:49 +03:00
|
|
|
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;
|
2020-10-21 14:36:46 +03:00
|
|
|
|
|
|
|
[ChromeOnly]
|
|
|
|
readonly attribute GleanImpl Glean;
|
2020-12-14 19:50:07 +03:00
|
|
|
[ChromeOnly]
|
|
|
|
readonly attribute GleanPingsImpl GleanPings;
|
2017-10-06 14:47:27 +03:00
|
|
|
};
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2021-08-31 15:59:15 +03:00
|
|
|
#ifndef RELEASE_OR_BETA
|
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;
|
|
|
|
};
|
2021-08-31 15:59:15 +03:00
|
|
|
#endif
|
2016-12-17 00:21:51 +03:00
|
|
|
|
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"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined cancelIdleCallback(unsigned long handle);
|
2016-08-22 15:52:45 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary IdleRequestOptions {
|
|
|
|
unsigned long timeout;
|
|
|
|
};
|
|
|
|
|
2022-09-21 10:44:58 +03:00
|
|
|
callback IdleRequestCallback = undefined (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;
|
2021-02-03 20:35:41 +03:00
|
|
|
};
|
2018-08-20 23:28:42 +03:00
|
|
|
|
2021-02-03 20:35:41 +03:00
|
|
|
// Used to assign marks to appear on the scrollbar when
|
|
|
|
// finding on a page.
|
|
|
|
partial interface Window {
|
2022-03-08 08:27:42 +03:00
|
|
|
// The marks are values between 0 and scrollMax{X,Y} - scrollMin{X,Y}.
|
2021-02-03 20:35:41 +03:00
|
|
|
[ChromeOnly]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined setScrollMarks(sequence<unsigned long> marks,
|
|
|
|
optional boolean onHorizontalScrollbar = false);
|
2018-08-20 23:28:42 +03:00
|
|
|
};
|
2018-10-29 18:26:30 +03:00
|
|
|
|
2021-09-29 15:48:17 +03:00
|
|
|
dictionary WindowPostMessageOptions : StructuredSerializeOptions {
|
2018-10-29 18:26:30 +03:00
|
|
|
USVString targetOrigin = "/";
|
|
|
|
};
|