aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/window.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2014-07-21 20:23:02 +0100
committerSimon Sapin <simon.sapin@exyr.org>2014-07-21 20:23:02 +0100
commit3670ee6f1fc5066101cc5a357443494552ea37f2 (patch)
tree3fa174faace875c0f8bb83cb4f1668f46141948c /src/components/script/dom/window.rs
parentf07d999463fd80ec55cef9e673a1dc08954b6d74 (diff)
parentb84065f5749b42792c4c7b890be23e81651beab5 (diff)
downloadservo-3670ee6f1fc5066101cc5a357443494552ea37f2.tar.gz
servo-3670ee6f1fc5066101cc5a357443494552ea37f2.zip
Merge pull request #2875 from SimonSapin/rust-url
Start dogfooding rust-url
Diffstat (limited to 'src/components/script/dom/window.rs')
-rw-r--r--src/components/script/dom/window.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/components/script/dom/window.rs b/src/components/script/dom/window.rs
index b8a1bb8dce5..ee1cce1a22e 100644
--- a/src/components/script/dom/window.rs
+++ b/src/components/script/dom/window.rs
@@ -24,7 +24,6 @@ use servo_msg::compositor_msg::ScriptListener;
use servo_net::image_cache_task::ImageCacheTask;
use servo_util::str::DOMString;
use servo_util::task::{spawn_named};
-use servo_util::url::parse_url;
use js::jsapi::JS_CallFunctionValue;
use js::jsapi::JSContext;
@@ -46,7 +45,7 @@ use std::rc::Rc;
use time;
use serialize::{Encoder, Encodable};
-use url::Url;
+use url::{Url, UrlParser};
#[deriving(PartialEq, Encodable, Eq)]
pub struct TimerId(i32);
@@ -316,9 +315,11 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {
/// Commence a new URL load which will either replace this window or scroll to a fragment.
fn load_url(&self, href: DOMString) {
- let base_url = Some(self.page().get_url());
+ let base_url = self.page().get_url();
debug!("current page url is {:?}", base_url);
- let url = parse_url(href.as_slice(), base_url);
+ let url = UrlParser::new().base_url(&base_url).parse(href.as_slice());
+ // FIXME: handle URL parse errors more gracefully.
+ let url = url.unwrap();
let ScriptChan(ref script_chan) = self.script_chan;
if href.as_slice().starts_with("#") {
script_chan.send(TriggerFragmentMsg(self.page.id, url));