aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/script_task.rs
diff options
context:
space:
mode:
authorlpy <pylaurent1314@gmail.com>2014-02-27 23:22:48 +0800
committerlpy <pylaurent1314@gmail.com>2014-02-28 14:13:08 +0800
commit8fc5ba5dc68c60b91da94321e78e5b09390249de (patch)
treea9744b28ca7738410516b4aa8c2e23a47b558176 /src/components/script/script_task.rs
parent94a12469f05f8f00092a88ff1ae11fc33c086bbb (diff)
downloadservo-8fc5ba5dc68c60b91da94321e78e5b09390249de.tar.gz
servo-8fc5ba5dc68c60b91da94321e78e5b09390249de.zip
Add url getter to Page and fix users of Page url with it.(fixes #1762)
Diffstat (limited to 'src/components/script/script_task.rs')
-rw-r--r--src/components/script/script_task.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs
index 01539dcd128..a4fc38f1d28 100644
--- a/src/components/script/script_task.rs
+++ b/src/components/script/script_task.rs
@@ -261,6 +261,10 @@ impl Page {
};
}
+ pub fn get_url(&self) -> Url {
+ self.url.get_ref().first().clone()
+ }
+
/// Sends a ping to layout and waits for the response. The response will arrive when the
/// layout task has finished any pending request messages.
pub fn join_layout(&mut self) {
@@ -332,7 +336,7 @@ impl Page {
let root: JS<Node> = NodeCast::from(&root);
let reflow = ~Reflow {
document_root: root.to_trusted_node_address(),
- url: self.url.get_ref().first().clone(),
+ url: self.get_url(),
goal: goal,
window_size: self.window_size,
script_chan: script_chan,
@@ -989,9 +993,7 @@ impl ScriptTask {
for href in attr.iter() {
debug!("ScriptTask: clicked on link to {:s}", href.get().Value());
let click_frag = href.get().value_ref().starts_with("#");
- let base_url = page.url.as_ref().map(|&(ref url, _)| {
- url.clone()
- });
+ let base_url = Some(page.get_url());
debug!("ScriptTask: current url is {:?}", base_url);
let url = parse_url(href.get().value_ref(), base_url);