mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update Worker webidl to support WorkerOptions
This commit is contained in:
parent
81f750afa7
commit
dececad390
11 changed files with 57 additions and 22 deletions
|
@ -24,6 +24,6 @@ interface ServiceWorkerContainer : EventTarget {
|
|||
|
||||
dictionary RegistrationOptions {
|
||||
USVString scope;
|
||||
//WorkerType type = "classic";
|
||||
WorkerType type = "classic";
|
||||
ServiceWorkerUpdateViaCache updateViaCache = "imports";
|
||||
};
|
||||
|
|
|
@ -9,12 +9,22 @@ interface AbstractWorker {
|
|||
};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#worker
|
||||
[Constructor(DOMString scriptURL), Exposed=(Window,Worker)]
|
||||
[Constructor(USVString scriptURL, optional WorkerOptions options), Exposed=(Window,Worker)]
|
||||
interface Worker : EventTarget {
|
||||
void terminate();
|
||||
|
||||
[Throws]
|
||||
void postMessage(any message/*, optional sequence<Transferable> transfer*/);
|
||||
attribute EventHandler onmessage;
|
||||
[Throws] void postMessage(any message/*, sequence<object> transfer*/);
|
||||
// void postMessage(any message, optional PostMessageOptions options);
|
||||
attribute EventHandler onmessage;
|
||||
attribute EventHandler onmessageerror;
|
||||
};
|
||||
|
||||
dictionary WorkerOptions {
|
||||
WorkerType type = "classic";
|
||||
RequestCredentials credentials = "same-origin"; // credentials is only used if type is "module"
|
||||
DOMString name = "";
|
||||
};
|
||||
|
||||
enum WorkerType { "classic", "module" };
|
||||
|
||||
Worker implements AbstractWorker;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue