2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2016-10-10 22:09:00 +03: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:
|
|
|
|
* https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope-mixin
|
|
|
|
* https://fetch.spec.whatwg.org/#fetch-method
|
2016-10-10 22:09:00 +03:00
|
|
|
* https://w3c.github.io/webappsec-secure-contexts/#monkey-patching-global-object
|
2016-11-12 00:09:05 +03:00
|
|
|
* https://w3c.github.io/ServiceWorker/#self-caches
|
2016-10-10 22:09:00 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope-mixin
|
2019-09-24 18:22:26 +03:00
|
|
|
[Exposed=(Window,Worker)]
|
|
|
|
interface mixin WindowOrWorkerGlobalScope {
|
2017-02-14 00:06:47 +03:00
|
|
|
[Replaceable] readonly attribute USVString origin;
|
2016-10-10 22:09:00 +03:00
|
|
|
|
|
|
|
// base64 utility methods
|
|
|
|
[Throws]
|
|
|
|
DOMString btoa(DOMString btoa);
|
|
|
|
[Throws]
|
|
|
|
DOMString atob(DOMString atob);
|
|
|
|
|
|
|
|
// timers
|
|
|
|
// NOTE: We're using overloads where the spec uses a union. Should
|
|
|
|
// be black-box the same.
|
|
|
|
[Throws]
|
|
|
|
long setTimeout(Function handler, optional long timeout = 0, any... arguments);
|
|
|
|
[Throws]
|
|
|
|
long setTimeout(DOMString handler, optional long timeout = 0, any... unused);
|
|
|
|
void clearTimeout(optional long handle = 0);
|
|
|
|
[Throws]
|
2018-05-03 06:20:00 +03:00
|
|
|
long setInterval(Function handler, optional long timeout = 0, any... arguments);
|
2016-10-10 22:09:00 +03:00
|
|
|
[Throws]
|
2018-05-03 06:20:00 +03:00
|
|
|
long setInterval(DOMString handler, optional long timeout = 0, any... unused);
|
2016-10-10 22:09:00 +03:00
|
|
|
void clearInterval(optional long handle = 0);
|
2019-05-24 11:27:03 +03:00
|
|
|
|
|
|
|
// microtask queuing
|
|
|
|
void queueMicrotask(VoidFunction callback);
|
2016-10-10 22:09:00 +03:00
|
|
|
|
|
|
|
// ImageBitmap
|
|
|
|
[Throws]
|
2019-10-04 18:20:53 +03:00
|
|
|
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource aImage, optional ImageBitmapOptions aOptions = {});
|
2016-10-10 22:09:00 +03:00
|
|
|
[Throws]
|
2019-10-04 18:20:53 +03:00
|
|
|
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource aImage, long aSx, long aSy, long aSw, long aSh, optional ImageBitmapOptions aOptions = {});
|
2016-10-10 22:09:00 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
// https://fetch.spec.whatwg.org/#fetch-method
|
2019-09-24 18:22:26 +03:00
|
|
|
partial interface mixin WindowOrWorkerGlobalScope {
|
2017-02-01 23:43:37 +03:00
|
|
|
[NewObject, NeedsCallerType]
|
2019-07-03 10:52:35 +03:00
|
|
|
Promise<Response> fetch(RequestInfo input, optional RequestInit init = {});
|
2016-10-10 22:09:00 +03:00
|
|
|
};
|
|
|
|
|
2016-10-10 22:09:00 +03:00
|
|
|
// https://w3c.github.io/webappsec-secure-contexts/#monkey-patching-global-object
|
2019-09-24 18:22:26 +03:00
|
|
|
partial interface mixin WindowOrWorkerGlobalScope {
|
2016-10-10 22:09:00 +03:00
|
|
|
readonly attribute boolean isSecureContext;
|
|
|
|
};
|
|
|
|
|
2016-10-24 05:41:13 +03:00
|
|
|
// http://w3c.github.io/IndexedDB/#factory-interface
|
2019-09-24 18:22:26 +03:00
|
|
|
partial interface mixin WindowOrWorkerGlobalScope {
|
2016-10-24 05:41:13 +03:00
|
|
|
// readonly attribute IDBFactory indexedDB;
|
|
|
|
[Throws]
|
|
|
|
readonly attribute IDBFactory? indexedDB;
|
|
|
|
};
|
|
|
|
|
2016-11-12 00:09:05 +03:00
|
|
|
// https://w3c.github.io/ServiceWorker/#self-caches
|
2019-09-24 18:22:26 +03:00
|
|
|
partial interface mixin WindowOrWorkerGlobalScope {
|
2019-06-13 12:01:41 +03:00
|
|
|
[Throws, Pref="dom.caches.enabled", SameObject]
|
2016-11-12 00:09:05 +03:00
|
|
|
readonly attribute CacheStorage caches;
|
|
|
|
};
|