script: Make callbacks generic over DOM interfaces. (#35459)

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-02-21 07:17:11 -05:00 committed by GitHub
parent 2b0d2ecc73
commit a433b20259
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 141 additions and 97 deletions

View file

@ -3348,6 +3348,10 @@ pub(crate) trait GlobalScopeHelpers<D: crate::DomTypes> {
) -> DomRoot<D::GlobalScope>;
fn origin(&self) -> &MutableOrigin;
fn incumbent() -> Option<DomRoot<D::GlobalScope>>;
fn perform_a_microtask_checkpoint(&self, can_gc: CanGc);
}
#[allow(unsafe_code)]
@ -3375,4 +3379,12 @@ impl GlobalScopeHelpers<crate::DomTypeHolder> for GlobalScope {
fn origin(&self) -> &MutableOrigin {
GlobalScope::origin(self)
}
fn incumbent() -> Option<DomRoot<Self>> {
GlobalScope::incumbent()
}
fn perform_a_microtask_checkpoint(&self, can_gc: CanGc) {
GlobalScope::perform_a_microtask_checkpoint(self, can_gc)
}
}