From f5472c1295e3baf3ca8e71d46e94387651f7bab5 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Wed, 30 Jul 2025 14:05:50 +0200 Subject: [PATCH] Move idle message sending to `Window::update_the_rendering` --- components/script/dom/document.rs | 7 ++++++- components/script/script_thread.rs | 13 ------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index ea57e7a3b41..11a6a4d0a12 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -3723,7 +3723,12 @@ impl Document { receiver.recv().unwrap(); } - self.window().reflow(ReflowGoal::UpdateTheRendering, can_gc) + let result = self.window().reflow(ReflowGoal::UpdateTheRendering, can_gc); + + self.window() + .maybe_send_idle_document_state_to_constellation(); + + result } pub(crate) fn id_map(&self) -> Ref>>> { diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 036bd601c03..e8222290d0a 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1400,18 +1400,6 @@ impl ScriptThread { } } - fn maybe_send_idle_document_state_to_constellation(&self) { - if !opts::get().wait_for_stable_image { - return; - } - - for (_, document) in self.documents.borrow().iter() { - document - .window() - .maybe_send_idle_document_state_to_constellation(); - } - } - fn maybe_schedule_rendering_opportunity_after_ipc_message(&self, can_gc: CanGc) { if self.has_pending_animation_tick.load(Ordering::Relaxed) { self.update_the_rendering(can_gc); @@ -1659,7 +1647,6 @@ impl ScriptThread { } self.maybe_schedule_rendering_opportunity_after_ipc_message(can_gc); - self.maybe_send_idle_document_state_to_constellation(); true }