mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
constellation: Proxy ScrollState
through the Constellation
(#36062)
This will allow removing the dependency of the compositor on `script_traits`, which should make our internal dependency chain a lot easier to deal with. Part of #35984. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
ec20d9a3d7
commit
1f232eb17c
10 changed files with 60 additions and 33 deletions
|
@ -160,7 +160,7 @@ use webgpu::{self, WebGPU, WebGPURequest, WebGPUResponse};
|
|||
use webrender::RenderApi;
|
||||
use webrender::RenderApiSender;
|
||||
use webrender_api::{DocumentId, ImageKey};
|
||||
use webrender_traits::{CompositorHitTestResult, WebrenderExternalImageRegistry};
|
||||
use webrender_traits::{CompositorHitTestResult, ScrollState, WebrenderExternalImageRegistry};
|
||||
|
||||
use crate::browsingcontext::{
|
||||
AllBrowsingContextsIterator, BrowsingContext, FullyActiveBrowsingContextsIterator,
|
||||
|
@ -1406,6 +1406,9 @@ where
|
|||
FromCompositorMsg::SetWebViewThrottled(webview_id, throttled) => {
|
||||
self.set_webview_throttled(webview_id, throttled);
|
||||
},
|
||||
FromCompositorMsg::SetScrollStates(pipeline_id, scroll_states) => {
|
||||
self.handle_set_scroll_states(pipeline_id, scroll_states)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5562,4 +5565,24 @@ where
|
|||
error!("Got a media session action but no active media session is registered");
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(skip_all, fields(servo_profiling = true), level = "trace")
|
||||
)]
|
||||
fn handle_set_scroll_states(&self, pipeline_id: PipelineId, scroll_states: Vec<ScrollState>) {
|
||||
let Some(pipeline) = self.pipelines.get(&pipeline_id) else {
|
||||
warn!("Discarding scroll offset update for unknown pipeline");
|
||||
return;
|
||||
};
|
||||
if let Err(error) = pipeline
|
||||
.event_loop
|
||||
.send(ScriptThreadMessage::SetScrollStates(
|
||||
pipeline_id,
|
||||
scroll_states,
|
||||
))
|
||||
{
|
||||
warn!("Could not send scroll offsets to pipeline: {pipeline_id:?}: {error:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ mod from_compositor {
|
|||
Self::ExitFullScreen(_) => target!("ExitFullScreen"),
|
||||
Self::MediaSessionAction(_) => target!("MediaSessionAction"),
|
||||
Self::SetWebViewThrottled(_, _) => target!("SetWebViewThrottled"),
|
||||
Self::SetScrollStates(..) => target!("SetScrollStates"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue