diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2014-07-19 18:45:11 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2014-07-21 20:22:29 +0100 |
commit | 6917fbf28e977f1e1da2e349b8f1685e267eb045 (patch) | |
tree | 38ad2d20aeb111fdc4eec3cd6468b9d6415d94b8 /src/components/script/dom/window.rs | |
parent | 779cb44a44b195eb7a88e69a4f2e5551f85448e1 (diff) | |
download | servo-6917fbf28e977f1e1da2e349b8f1685e267eb045.tar.gz servo-6917fbf28e977f1e1da2e349b8f1685e267eb045.zip |
Used rust-url directly instead of servo_util::url
The latter now only calls the former.
Diffstat (limited to 'src/components/script/dom/window.rs')
-rw-r--r-- | src/components/script/dom/window.rs | 9 |
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)); |