aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webidls/Worker.webidl
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/webidls/Worker.webidl')
-rw-r--r--components/script/dom/webidls/Worker.webidl27
1 files changed, 19 insertions, 8 deletions
diff --git a/components/script/dom/webidls/Worker.webidl b/components/script/dom/webidls/Worker.webidl
index deb519d78df..93df577ec32 100644
--- a/components/script/dom/webidls/Worker.webidl
+++ b/components/script/dom/webidls/Worker.webidl
@@ -1,20 +1,31 @@
/* 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 http://mozilla.org/MPL/2.0/. */
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#abstractworker
-[NoInterfaceObject, Exposed=(Window,Worker)]
-interface AbstractWorker {
+[Exposed=(Window,Worker)]
+interface mixin AbstractWorker {
attribute EventHandler onerror;
};
// https://html.spec.whatwg.org/multipage/#worker
-[Constructor(DOMString scriptURL), Exposed=(Window,Worker)]
+[Exposed=(Window,Worker)]
interface Worker : EventTarget {
+ [Throws] constructor(USVString scriptURL, optional WorkerOptions options = {});
void terminate();
-[Throws]
-void postMessage(any message/*, optional sequence<Transferable> transfer*/);
- attribute EventHandler onmessage;
+ [Throws] void postMessage(any message, sequence<object> transfer);
+ [Throws] void postMessage(any message, optional PostMessageOptions options = {});
+ attribute EventHandler onmessage;
+ attribute EventHandler onmessageerror;
};
-Worker implements AbstractWorker;
+
+dictionary WorkerOptions {
+ WorkerType type = "classic";
+ RequestCredentials credentials = "same-origin"; // credentials is only used if type is "module"
+ DOMString name = "";
+};
+
+enum WorkerType { "classic", "module" };
+
+Worker includes AbstractWorker;