aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs34
1 files changed, 21 insertions, 13 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 7241c115a2a..54cf89a213f 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -745,7 +745,9 @@ impl ScriptThread {
.senders
.pipeline_to_constellation_sender
.clone(),
- image_cache: script_thread.image_cache.clone(),
+ image_cache: script_thread
+ .image_cache
+ .create_new_image_cache(script_thread.compositor_api.clone()),
#[cfg(feature = "webgpu")]
gpu_id_hub: script_thread.gpu_id_hub.clone(),
inherited_secure_context: script_thread.inherited_secure_context,
@@ -2067,6 +2069,9 @@ impl ScriptThread {
None => warn!("Message sent to closed pipeline {}.", id),
}
},
+ DevtoolScriptControlMsg::HighlightDomNode(id, node_id) => {
+ devtools::handle_highlight_dom_node(&documents, id, node_id)
+ },
}
}
@@ -2443,8 +2448,6 @@ impl ScriptThread {
let prefix = format!("url({urls})");
reports.extend(self.get_cx().get_reports(prefix.clone(), ops));
-
- reports.push(self.image_cache.memory_report(&prefix, ops));
});
reports_chan.send(ProcessReports::new(reports));
@@ -2813,8 +2816,6 @@ impl ScriptThread {
) {
debug!("{id}: Starting pipeline exit.");
- self.closed_pipelines.borrow_mut().insert(id);
-
// Abort the parser, if any,
// to prevent any further incoming networking messages from being handled.
let document = self.documents.borrow_mut().remove(id);
@@ -2835,12 +2836,6 @@ impl ScriptThread {
debug!("{id}: Shutting down layout");
document.window().layout_mut().exit_now();
- debug!("{id}: Sending PipelineExited message to constellation");
- self.senders
- .pipeline_to_constellation_sender
- .send((id, ScriptToConstellationMessage::PipelineExited))
- .ok();
-
// Clear any active animations and unroot all of the associated DOM objects.
debug!("{id}: Clearing animations");
document.animations().clear();
@@ -2863,6 +2858,15 @@ impl ScriptThread {
window.clear_js_runtime();
}
+ // Prevent any further work for this Pipeline.
+ self.closed_pipelines.borrow_mut().insert(id);
+
+ debug!("{id}: Sending PipelineExited message to constellation");
+ self.senders
+ .pipeline_to_constellation_sender
+ .send((id, ScriptToConstellationMessage::PipelineExited))
+ .ok();
+
debug!("{id}: Finished pipeline exit");
}
@@ -3145,13 +3149,17 @@ impl ScriptThread {
self.resource_threads.clone(),
));
+ let image_cache = self
+ .image_cache
+ .create_new_image_cache(self.compositor_api.clone());
+
let layout_config = LayoutConfig {
id: incomplete.pipeline_id,
webview_id: incomplete.webview_id,
url: final_url.clone(),
is_iframe: incomplete.parent_info.is_some(),
script_chan: self.senders.constellation_sender.clone(),
- image_cache: self.image_cache.clone(),
+ image_cache: image_cache.clone(),
font_context: font_context.clone(),
time_profiler_chan: self.senders.time_profiler_sender.clone(),
compositor_api: self.compositor_api.clone(),
@@ -3166,7 +3174,7 @@ impl ScriptThread {
self.layout_factory.create(layout_config),
font_context,
self.senders.image_cache_sender.clone(),
- self.image_cache.clone(),
+ image_cache.clone(),
self.resource_threads.clone(),
#[cfg(feature = "bluetooth")]
self.senders.bluetooth_sender.clone(),