Move idle message sending to Window::update_the_rendering

This commit is contained in:
Martin Robinson 2025-07-30 14:05:50 +02:00
parent 851195c3ce
commit f5472c1295
2 changed files with 6 additions and 14 deletions

View file

@ -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<HashMapTracedValues<Atom, Vec<Dom<Element>>>> {

View file

@ -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
}