refactor: add CanGc as argument to WindowProxy::set_window (#35609)

Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
Yerkebulan Tulibergenov 2025-02-22 16:34:31 -08:00 committed by GitHub
parent 4d1e9f19b5
commit 02199520f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 16 deletions

View file

@ -2541,13 +2541,13 @@ impl Window {
had_clip_rect
}
pub(crate) fn suspend(&self) {
pub(crate) fn suspend(&self, can_gc: CanGc) {
// Suspend timer events.
self.as_global_scope().suspend();
// Set the window proxy to be a cross-origin window.
if self.window_proxy().currently_active() == Some(self.global().pipeline_id()) {
self.window_proxy().unset_currently_active();
self.window_proxy().unset_currently_active(can_gc);
}
// A hint to the JS runtime that now would be a good time to
@ -2557,12 +2557,12 @@ impl Window {
self.Gc();
}
pub(crate) fn resume(&self) {
pub(crate) fn resume(&self, can_gc: CanGc) {
// Resume timer events.
self.as_global_scope().resume();
// Set the window proxy to be this object.
self.window_proxy().set_currently_active(self);
self.window_proxy().set_currently_active(self, can_gc);
// Push the document title to the compositor since we are
// activating this document due to a navigation.