ladybird/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.idl
Andrew Kaster b10fee00eb LibWeb+WebWorker: Convert Workers to use MessagePorts for postMessage
This aligns Workers and Window and MessagePorts to all use the same
mechanism for transferring serialized messages across realms.

It also allows transferring more message ports into a worker.

Re-enable the Worker-echo test, as none of the MessagePort tests have
themselves been flaky, and those are now using the same underlying
implementation.
2023-12-25 12:09:11 +01:00

31 lines
1.1 KiB
Plaintext

#import <DOM/EventTarget.idl>
#import <DOM/EventHandler.idl>
#import <HTML/WindowOrWorkerGlobalScope.idl>
#import <HTML/WorkerLocation.idl>
#import <HTML/WorkerNavigator.idl>
#import <HTML/MessagePort.idl>
// https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope
[Exposed=Worker]
interface WorkerGlobalScope : EventTarget {
readonly attribute WorkerGlobalScope self;
readonly attribute WorkerLocation location;
readonly attribute WorkerNavigator navigator;
undefined importScripts(USVString... urls);
attribute OnErrorEventHandler onerror;
attribute EventHandler onlanguagechange;
attribute EventHandler onoffline;
attribute EventHandler ononline;
attribute EventHandler onrejectionhandled;
attribute EventHandler onunhandledrejection;
// FIXME: IDL overload issue here
// FIXME: undefined postMessage(any message, sequence<object> transfer);
undefined postMessage(any message, optional StructuredSerializeOptions options = {});
attribute EventHandler onmessage;
attribute EventHandler onmessageerror;
};
WorkerGlobalScope includes WindowOrWorkerGlobalScope;