summaryrefslogtreecommitdiffstats
path: root/dom/webidl
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-06-12 07:46:54 +0000
committerMoonchild <moonchild@palemoon.org>2020-06-12 07:46:54 +0000
commit59a5adc93415f6d6e8ce4352ba0cd2d34d5e7888 (patch)
tree10e0e65ef7fe712e885826b3704cbf03cda2ebd1 /dom/webidl
parent433c300a370789a2f7c848cb74f1dee6565610d8 (diff)
parent927c2fd3ea9e2af55530f1e07b862c3c43eb0054 (diff)
downloadUXP-59a5adc93415f6d6e8ce4352ba0cd2d34d5e7888.tar
UXP-59a5adc93415f6d6e8ce4352ba0cd2d34d5e7888.tar.gz
UXP-59a5adc93415f6d6e8ce4352ba0cd2d34d5e7888.tar.lz
UXP-59a5adc93415f6d6e8ce4352ba0cd2d34d5e7888.tar.xz
UXP-59a5adc93415f6d6e8ce4352ba0cd2d34d5e7888.zip
Merge branch 'abortcontroller-work'
Diffstat (limited to 'dom/webidl')
-rw-r--r--dom/webidl/AbortController.webidl13
-rw-r--r--dom/webidl/AbortSignal.webidl13
-rw-r--r--dom/webidl/FetchObserver.webidl27
-rw-r--r--dom/webidl/Request.webidl6
-rw-r--r--dom/webidl/moz.build3
5 files changed, 62 insertions, 0 deletions
diff --git a/dom/webidl/AbortController.webidl b/dom/webidl/AbortController.webidl
new file mode 100644
index 000000000..4e9124075
--- /dev/null
+++ b/dom/webidl/AbortController.webidl
@@ -0,0 +1,13 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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/.
+ */
+
+[Constructor(), Exposed=(Window,Worker),
+ Func="AbortController::IsEnabled"]
+interface AbortController {
+ readonly attribute AbortSignal signal;
+
+ void abort();
+};
diff --git a/dom/webidl/AbortSignal.webidl b/dom/webidl/AbortSignal.webidl
new file mode 100644
index 000000000..b4b03bb7e
--- /dev/null
+++ b/dom/webidl/AbortSignal.webidl
@@ -0,0 +1,13 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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/.
+ */
+
+[Exposed=(Window,Worker),
+ Func="AbortController::IsEnabled"]
+interface AbortSignal : EventTarget {
+ readonly attribute boolean aborted;
+
+ attribute EventHandler onabort;
+};
diff --git a/dom/webidl/FetchObserver.webidl b/dom/webidl/FetchObserver.webidl
new file mode 100644
index 000000000..eecd67e66
--- /dev/null
+++ b/dom/webidl/FetchObserver.webidl
@@ -0,0 +1,27 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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/.
+ */
+
+callback interface ObserverCallback {
+ void handleEvent(FetchObserver observer);
+};
+
+enum FetchState {
+ // Pending states
+ "requesting", "responding",
+ // Final states
+ "aborted", "errored", "complete"
+};
+
+[Exposed=(Window,Worker),
+ Func="FetchObserver::IsEnabled"]
+interface FetchObserver : EventTarget {
+ readonly attribute FetchState state;
+
+ // Events
+ attribute EventHandler onstatechange;
+ attribute EventHandler onrequestprogress;
+ attribute EventHandler onresponseprogress;
+};
diff --git a/dom/webidl/Request.webidl b/dom/webidl/Request.webidl
index e29c084d0..fe6a63ec0 100644
--- a/dom/webidl/Request.webidl
+++ b/dom/webidl/Request.webidl
@@ -47,6 +47,12 @@ dictionary RequestInit {
RequestCache cache;
RequestRedirect redirect;
DOMString integrity;
+
+ [Func="AbortController::IsEnabled"]
+ AbortSignal signal;
+
+ [Func="FetchObserver::IsEnabled"]
+ ObserverCallback observe;
};
// Gecko currently does not ship RequestContext, so please don't use it in IDL
diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build
index 78faeac12..8a86da783 100644
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -17,6 +17,8 @@ PREPROCESSED_WEBIDL_FILES = [
]
WEBIDL_FILES = [
+ 'AbortController.webidl',
+ 'AbortSignal.webidl',
'AbstractWorker.webidl',
'AnalyserNode.webidl',
'Animatable.webidl',
@@ -142,6 +144,7 @@ WEBIDL_FILES = [
'FakePluginTagInit.webidl',
'Fetch.webidl',
'FetchEvent.webidl',
+ 'FetchObserver.webidl',
'File.webidl',
'FileList.webidl',
'FileMode.webidl',