diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 5d7724725c2..0195addb747 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -671,6 +671,11 @@ impl IOCompositor { transaction .set_display_list(display_list_info.epoch, (pipeline_id, built_display_list)); self.update_transaction_with_all_scroll_offsets(&mut transaction); + self.global.borrow_mut().send_transaction(transaction); + }, + + CompositorMsg::GenerateFrame => { + let mut transaction = Transaction::new(); self.generate_frame(&mut transaction, RenderReasons::SCENE); self.global.borrow_mut().send_transaction(transaction); }, diff --git a/components/compositing/tracing.rs b/components/compositing/tracing.rs index 09b81eefec0..d9c07edb07a 100644 --- a/components/compositing/tracing.rs +++ b/components/compositing/tracing.rs @@ -42,6 +42,7 @@ mod from_constellation { Self::SendInitialTransaction(..) => target!("SendInitialTransaction"), Self::SendScrollNode(..) => target!("SendScrollNode"), Self::SendDisplayList { .. } => target!("SendDisplayList"), + Self::GenerateFrame { .. } => target!("GenerateFrame"), Self::GenerateImageKey(..) => target!("GenerateImageKey"), Self::UpdateImages(..) => target!("UpdateImages"), Self::GenerateFontKeys(..) => target!("GenerateFontKeys"), diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 49464f46ad7..cbb3410e179 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -2111,6 +2111,9 @@ impl Window { // properly process ScrollBehavior here. let reflow_phases_run = self.reflow(ReflowGoal::UpdateScrollNode(scroll_id, Vector2D::new(x, y))); + if reflow_phases_run.needs_frame() { + self.compositor_api().generate_frame(); + } // > If the scroll position did not change as a result of the user interaction or programmatic // > invocation, where no translations were applied as a result, then no scrollend event fires @@ -2351,7 +2354,9 @@ impl Window { // iframe size updates. // // See - self.Document().update_the_rendering(); + if self.Document().update_the_rendering().needs_frame() { + self.compositor_api().generate_frame(); + } } pub(crate) fn layout_blocked(&self) -> bool { diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 5f8e22a42a8..0ffb8299fc1 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -67,9 +67,7 @@ use js::jsapi::{ }; use js::jsval::UndefinedValue; use js::rust::ParentRuntime; -use layout_api::{ - LayoutConfig, LayoutFactory, ReflowPhasesRun, RestyleReason, ScriptThreadFactory, -}; +use layout_api::{LayoutConfig, LayoutFactory, RestyleReason, ScriptThreadFactory}; use media::WindowGLContext; use metrics::MAX_TASK_NS; use net_traits::image_cache::{ImageCache, ImageCacheResponseMessage}; @@ -1118,7 +1116,7 @@ impl ScriptThread { // steps per doc in docs. Currently `