dom: implement signal method on abort controller (#37217)

Part of https://github.com/servo/servo/issues/34866

The "Finish current stub for AbortController" item.

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
This commit is contained in:
Gregory Terzian 2025-06-02 21:20:57 +08:00 committed by GitHub
parent c28394f476
commit 99add66f8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -69,4 +69,10 @@ impl AbortControllerMethods<crate::DomTypeHolder> for AbortController {
// to signal abort on this with reason if it is given.
self.signal_abort(cx, reason, can_gc);
}
/// <https://dom.spec.whatwg.org/#dom-abortcontroller-signal>
fn Signal(&self) -> DomRoot<AbortSignal> {
// The signal getter steps are to return thiss signal.
self.signal.as_rooted()
}
}

View file

@ -7,7 +7,7 @@
interface AbortController {
constructor();
//[SameObject] readonly attribute AbortSignal signal;
[SameObject] readonly attribute AbortSignal signal;
undefined abort(optional any reason);
};