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

@ -693,7 +693,7 @@ impl Document {
self.activity.get() != DocumentActivity::Inactive
}
pub(crate) fn set_activity(&self, activity: DocumentActivity) {
pub(crate) fn set_activity(&self, activity: DocumentActivity, can_gc: CanGc) {
// This function should only be called on documents with a browsing context
assert!(self.has_browsing_context);
if activity == self.activity.get() {
@ -708,14 +708,14 @@ impl Document {
ClientContextId::build(pipeline_id.namespace_id.0, pipeline_id.index.0.get());
if activity != DocumentActivity::FullyActive {
self.window().suspend();
self.window().suspend(can_gc);
media.suspend(&client_context_id);
return;
}
self.title_changed();
self.dirty_all_nodes();
self.window().resume();
self.window().resume(can_gc);
media.resume(&client_context_id);
if self.ready_state.get() != DocumentReadyState::Complete {