/
WindowOrWorkerGlobalScope.webidl
40 lines (31 loc) · 1.47 KB
/
WindowOrWorkerGlobalScope.webidl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* 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 https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#windoworworkerglobalscope
typedef (DOMString or Function) TimerHandler;
[Exposed=(Window,Worker)]
interface mixin WindowOrWorkerGlobalScope {
[Replaceable] readonly attribute USVString origin;
// base64 utility methods
[Throws] DOMString btoa(DOMString data);
[Throws] DOMString atob(DOMString data);
// timers
long setTimeout(TimerHandler handler, optional long timeout = 0, any... arguments);
void clearTimeout(optional long handle = 0);
long setInterval(TimerHandler handler, optional long timeout = 0, any... arguments);
void clearInterval(optional long handle = 0);
// microtask queuing
void queueMicrotask(VoidFunction callback);
// ImageBitmap
[Pref="dom.imagebitmap.enabled"]
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options = {});
// Promise<ImageBitmap> createImageBitmap(
// ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options);
};
// https://w3c.github.io/hr-time/#the-performance-attribute
partial interface mixin WindowOrWorkerGlobalScope {
[Replaceable]
readonly attribute Performance performance;
};
Window includes WindowOrWorkerGlobalScope;
WorkerGlobalScope includes WindowOrWorkerGlobalScope;