mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
dom: implement aborted method of abort signal (#37218)
Implement the `aborted` member of `AbortSignal`. Part of https://github.com/servo/servo/issues/36935 Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
This commit is contained in:
parent
dfa8dde1ca
commit
1dfc14d2fb
1 changed files with 8 additions and 2 deletions
|
@ -115,13 +115,19 @@ impl AbortSignal {
|
|||
self.upcast::<EventTarget>()
|
||||
.fire_event(atom!("abort"), can_gc);
|
||||
}
|
||||
|
||||
/// <https://dom.spec.whatwg.org/#abortsignal-aborted>
|
||||
fn aborted(&self) -> bool {
|
||||
// An AbortSignal object is aborted when its abort reason is not undefined.
|
||||
!self.abort_reason.get().is_undefined()
|
||||
}
|
||||
}
|
||||
|
||||
impl AbortSignalMethods<crate::DomTypeHolder> for AbortSignal {
|
||||
/// <https://dom.spec.whatwg.org/#dom-abortsignal-aborted>
|
||||
fn Aborted(&self) -> bool {
|
||||
// TODO
|
||||
false
|
||||
// The aborted getter steps are to return true if this is aborted; otherwise false.
|
||||
self.aborted()
|
||||
}
|
||||
|
||||
/// <https://dom.spec.whatwg.org/#dom-abortsignal-reason>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue