diff --git a/components/compositing/webview.rs b/components/compositing/webview.rs index 6799610e35b..17402f7f988 100644 --- a/components/compositing/webview.rs +++ b/components/compositing/webview.rs @@ -17,7 +17,7 @@ use embedder_traits::{ use euclid::{Point2D, Scale, Vector2D}; use fnv::FnvHashSet; use log::{debug, warn}; -use script_traits::{AnimationState, ScriptThreadMessage, TouchEventResult}; +use script_traits::{AnimationState, TouchEventResult}; use webrender::Transaction; use webrender_api::units::{DeviceIntPoint, DevicePoint, DeviceRect, LayoutVector2D}; use webrender_api::{ @@ -158,10 +158,14 @@ impl WebView { } }); - if let Some(pipeline) = details.pipeline.as_ref() { - let message = ScriptThreadMessage::SetScrollStates(pipeline_id, scroll_states); - let _ = pipeline.script_chan.send(message); - } + let _ = self + .global + .borrow() + .constellation_sender + .send(ConstellationMsg::SetScrollStates( + pipeline_id, + scroll_states, + )); } pub(crate) fn set_frame_tree_on_pipeline_details( diff --git a/components/constellation/event_loop.rs b/components/constellation/event_loop.rs index 68afe8a278d..362960eba64 100644 --- a/components/constellation/event_loop.rs +++ b/components/constellation/event_loop.rs @@ -38,9 +38,4 @@ impl EventLoop { pub fn send(&self, msg: ScriptThreadMessage) -> Result<(), Error> { self.script_chan.send(msg) } - - /// The underlying channel to the script thread. - pub fn sender(&self) -> IpcSender { - self.script_chan.clone() - } } diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index 469ebb173b0..b1ff106e353 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -422,7 +422,6 @@ impl Pipeline { CompositionPipeline { id: self.id, webview_id: self.webview_id, - script_chan: self.event_loop.sender(), } } diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 9f20a59cdf0..ed0495bfb67 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1878,16 +1878,12 @@ impl ScriptThread { panic!("should have handled {:?} already", msg) }, ScriptThreadMessage::SetScrollStates(pipeline_id, scroll_states) => { - self.handle_set_scroll_states_offsets(pipeline_id, scroll_states) + self.handle_set_scroll_states(pipeline_id, scroll_states) }, } } - fn handle_set_scroll_states_offsets( - &self, - pipeline_id: PipelineId, - scroll_states: Vec, - ) { + fn handle_set_scroll_states(&self, pipeline_id: PipelineId, scroll_states: Vec) { let Some(window) = self.documents.borrow().find_window(pipeline_id) else { warn!("Received scroll states for closed pipeline {pipeline_id}"); return; diff --git a/components/shared/compositing/lib.rs b/components/shared/compositing/lib.rs index 0caaf6c3187..738619ffc31 100644 --- a/components/shared/compositing/lib.rs +++ b/components/shared/compositing/lib.rs @@ -13,7 +13,7 @@ use euclid::Rect; use ipc_channel::ipc::IpcSender; use log::warn; use pixels::Image; -use script_traits::{AnimationState, ScriptThreadMessage, TouchEventResult}; +use script_traits::{AnimationState, TouchEventResult}; use strum_macros::IntoStaticStr; use style_traits::CSSPixel; use webrender_api::DocumentId; @@ -102,7 +102,6 @@ pub struct SendableFrameTree { pub struct CompositionPipeline { pub id: PipelineId, pub webview_id: WebViewId, - pub script_chan: IpcSender, } impl Debug for CompositorMsg {