ladybird/Libraries/LibWeb/HTML/Worker.idl
Sam Atkins 62d7011f45 LibWeb/HTML: Update worker construction spec steps
This is largely editorial. One behaviour change is that events are now
sent from a global task on the DOMManipulation task source.

Somewhat awkwardly, the spec refers to `this` before the Worker exists.
As it's for getting the relevant global object / settings object, I've
had to work around that.

Corresponds to:
917c2f6a73
2025-12-01 15:02:27 +01:00

29 lines
930 B
Text

#import <DOM/EventTarget.idl>
#import <DOM/EventHandler.idl>
#import <HTML/AbstractWorker.idl>
#import <HTML/MessagePort.idl>
#import <Fetch/Request.idl>
#import <TrustedTypes/TrustedScriptURL.idl>
// https://html.spec.whatwg.org/multipage/workers.html#worker
[Exposed=(Window,DedicatedWorker,SharedWorker)]
interface Worker : EventTarget {
constructor((TrustedScriptURL or Utf16USVString) scriptURL, optional WorkerOptions options = {});
undefined terminate();
undefined postMessage(any message, sequence<object> transfer);
undefined postMessage(any message, optional StructuredSerializeOptions options = {});
attribute EventHandler onmessage;
attribute EventHandler onmessageerror;
};
dictionary WorkerOptions {
DOMString name = "";
WorkerType type = "classic";
RequestCredentials credentials = "same-origin";
};
enum WorkerType { "classic", "module" };
Worker includes AbstractWorker;