mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
script: implement AbortController (#31361)
* Implement AbortController Signed-off-by: syvb <me@iter.ca> * Update WPT tests Signed-off-by: syvb <me@iter.ca> * Address review comments * Fix duplicate import generation * Update WPT test expectations * Change expectation to FAIL for flaky test --------- Signed-off-by: syvb <me@iter.ca>
This commit is contained in:
parent
383607d01e
commit
7fce850cff
88 changed files with 522 additions and 1194 deletions
13
components/script/dom/webidls/AbortController.webidl
Normal file
13
components/script/dom/webidls/AbortController.webidl
Normal file
|
@ -0,0 +1,13 @@
|
|||
/* 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 https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://dom.spec.whatwg.org/#interface-abortcontroller
|
||||
[Exposed=*]
|
||||
interface AbortController {
|
||||
constructor();
|
||||
|
||||
[SameObject] readonly attribute AbortSignal signal;
|
||||
|
||||
undefined abort(optional any reason);
|
||||
};
|
17
components/script/dom/webidls/AbortSignal.webidl
Normal file
17
components/script/dom/webidls/AbortSignal.webidl
Normal file
|
@ -0,0 +1,17 @@
|
|||
/* 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 https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://dom.spec.whatwg.org/#interface-AbortSignal
|
||||
[Exposed=*]
|
||||
interface AbortSignal : EventTarget {
|
||||
// [NewObject] static AbortSignal abort(optional any reason);
|
||||
// [Exposed=(Window,Worker), NewObject] static AbortSignal timeout([EnforceRange] unsigned long long milliseconds);
|
||||
// [NewObject] static AbortSignal _any(sequence<AbortSignal> signals);
|
||||
|
||||
readonly attribute boolean aborted;
|
||||
readonly attribute any reason;
|
||||
undefined throwIfAborted();
|
||||
|
||||
attribute EventHandler onabort;
|
||||
};
|
|
@ -31,4 +31,5 @@ dictionary EventListenerOptions {
|
|||
dictionary AddEventListenerOptions : EventListenerOptions {
|
||||
// boolean passive = false;
|
||||
boolean once = false;
|
||||
AbortSignal signal;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue