mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47:35 +00:00
LibWeb: Extract the WindowOrWorkerGlobalScope IDL mixin
`Window` itself isn't generated from an IDL file so it doesn't get to make use of this mixin, but it ideally would do so.
This commit is contained in:
parent
899fa30bdd
commit
b456adcb59
2 changed files with 32 additions and 9 deletions
28
Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.idl
Normal file
28
Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.idl
Normal file
|
@ -0,0 +1,28 @@
|
|||
// https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
|
||||
interface mixin WindowOrWorkerGlobalScope {
|
||||
[Replaceable] readonly attribute USVString origin;
|
||||
readonly attribute boolean isSecureContext;
|
||||
readonly attribute boolean crossOriginIsolated;
|
||||
|
||||
// FIXME: undefined reportError(any e);
|
||||
|
||||
// base64 utility methods
|
||||
DOMString btoa(DOMString data);
|
||||
ByteString atob(DOMString data);
|
||||
|
||||
// timers
|
||||
// FIXME: long setTimeout(TimerHandler handler, optional long timeout = 0, any... arguments);
|
||||
// FIXME: undefined clearTimeout(optional long id = 0);
|
||||
// FIXME: long setInterval(TimerHandler handler, optional long timeout = 0, any... arguments);
|
||||
// FIXME: undefined clearInterval(optional long id = 0);
|
||||
|
||||
// microtask queuing
|
||||
// FIXME: undefined queueMicrotask(VoidFunction callback);
|
||||
|
||||
// ImageBitmap
|
||||
// FIXME: Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options = {});
|
||||
// FIXME: Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options = {});
|
||||
|
||||
// structured cloning
|
||||
// FIXME: any structuredClone(any value, optional StructuredSerializeOptions options = {});
|
||||
};
|
|
@ -1,8 +1,10 @@
|
|||
#import <DOM/EventTarget.idl>
|
||||
#import <DOM/EventHandler.idl>
|
||||
#import <HTML/WindowOrWorkerGlobalScope.idl>
|
||||
#import <HTML/WorkerLocation.idl>
|
||||
#import <HTML/WorkerNavigator.idl>
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope
|
||||
[Exposed=Worker]
|
||||
interface WorkerGlobalScope : EventTarget {
|
||||
readonly attribute WorkerGlobalScope self;
|
||||
|
@ -16,13 +18,6 @@ interface WorkerGlobalScope : EventTarget {
|
|||
attribute EventHandler ononline;
|
||||
attribute EventHandler onrejectionhandled;
|
||||
attribute EventHandler onunhandledrejection;
|
||||
|
||||
// FIXME: These should all come from a WindowOrWorkerGlobalScope mixin
|
||||
[Replaceable] readonly attribute USVString origin;
|
||||
readonly attribute boolean isSecureContext;
|
||||
readonly attribute boolean crossOriginIsolated;
|
||||
|
||||
// base64 utility methods
|
||||
DOMString btoa(DOMString data);
|
||||
ByteString atob(DOMString data);
|
||||
};
|
||||
|
||||
WorkerGlobalScope includes WindowOrWorkerGlobalScope;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue