aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/compositing/constellation.rs5
-rw-r--r--components/script/script_task.rs4
-rw-r--r--components/script_traits/script_msg.rs2
3 files changed, 11 insertions, 0 deletions
diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs
index 7edb7c32282..426138cf313 100644
--- a/components/compositing/constellation.rs
+++ b/components/compositing/constellation.rs
@@ -622,6 +622,11 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
debug!("constellation got activate document message");
self.handle_activate_document_msg(pipeline_id);
}
+ // Update pipeline url after redirections
+ Request::Script(FromScriptMsg::SetFinalUrl(pipeline_id, final_url)) => {
+ debug!("constellation got set final url message");
+ self.mut_pipeline(pipeline_id).url = final_url;
+ }
Request::Script(FromScriptMsg::MozBrowserEvent(pipeline_id,
subpage_id,
event)) => {
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index 6d9b2bee301..92a55c62ada 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -1648,6 +1648,10 @@ impl ScriptTask {
// send the final url to the layout task.
let LayoutChan(ref chan) = incomplete.layout_chan;
chan.send(layout_interface::Msg::SetFinalUrl(final_url.clone())).unwrap();
+
+ // update the pipeline url
+ let ConstellationChan(ref chan) = self.constellation_chan;
+ chan.send(ConstellationMsg::SetFinalUrl(incomplete.pipeline_id, final_url.clone())).unwrap();
}
debug!("ScriptTask: loading {} on page {:?}", incomplete.url.serialize(), incomplete.pipeline_id);
diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs
index 1916551ed79..869f2428379 100644
--- a/components/script_traits/script_msg.rs
+++ b/components/script_traits/script_msg.rs
@@ -79,4 +79,6 @@ pub enum ScriptMsg {
ActivateDocument(PipelineId),
/// Set the document state for a pipeline (used by screenshot / reftests)
SetDocumentState(PipelineId, DocumentState),
+ /// Update the pipeline Url, which can change after redirections.
+ SetFinalUrl(PipelineId, Url),
}