diff options
author | Moonchild <moonchild@palemoon.org> | 2020-06-12 07:46:54 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-06-12 07:46:54 +0000 |
commit | 59a5adc93415f6d6e8ce4352ba0cd2d34d5e7888 (patch) | |
tree | 10e0e65ef7fe712e885826b3704cbf03cda2ebd1 /dom/webidl | |
parent | 433c300a370789a2f7c848cb74f1dee6565610d8 (diff) | |
parent | 927c2fd3ea9e2af55530f1e07b862c3c43eb0054 (diff) | |
download | uxp-59a5adc93415f6d6e8ce4352ba0cd2d34d5e7888.tar.gz |
Merge branch 'abortcontroller-work'
Diffstat (limited to 'dom/webidl')
-rw-r--r-- | dom/webidl/AbortController.webidl | 13 | ||||
-rw-r--r-- | dom/webidl/AbortSignal.webidl | 13 | ||||
-rw-r--r-- | dom/webidl/FetchObserver.webidl | 27 | ||||
-rw-r--r-- | dom/webidl/Request.webidl | 6 | ||||
-rw-r--r-- | dom/webidl/moz.build | 3 |
5 files changed, 62 insertions, 0 deletions
diff --git a/dom/webidl/AbortController.webidl b/dom/webidl/AbortController.webidl new file mode 100644 index 0000000000..4e91240751 --- /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 0000000000..b4b03bb7e1 --- /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 0000000000..eecd67e668 --- /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 e29c084d00..fe6a63ec0d 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 78faeac12e..8a86da783f 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', |