Merge remote-tracking branch 'origin/master' into custom

This commit is contained in:
Roy Tam 2020-06-12 22:15:24 +08:00
commit 0444ab984c
32 changed files with 1394 additions and 58 deletions

View file

@ -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();
};

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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

View file

@ -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',
@ -646,10 +649,10 @@ WEBIDL_FILES += [
# We only expose our prefable test interfaces in debug builds, just to be on
# the safe side.
if CONFIG['MOZ_DEBUG']:
WEBIDL_FILES += ['TestFunctions.webidl',
'TestInterfaceJS.webidl',
'TestInterfaceJSDictionaries.webidl',
'TestInterfaceJSMaplikeSetlikeIterable.webidl']
WEBIDL_FILES += [
'TestInterfaceJS.webidl',
'TestInterfaceJSDictionaries.webidl',
]
if CONFIG['MOZ_SECUREELEMENT']:
WEBIDL_FILES += [