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/html | |
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/html')
-rw-r--r-- | src/components/script/html/hubbub_html_parser.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index bc2c3e2c8f8..11e3ca81610 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -23,13 +23,12 @@ use servo_util::namespace; use servo_util::namespace::{Namespace, Null}; use servo_util::str::{DOMString, HTML_SPACE_CHARACTERS}; use servo_util::task::spawn_named; -use servo_util::url::try_parse_url; use std::ascii::StrAsciiExt; use std::mem; use std::cell::RefCell; use std::comm::{channel, Sender, Receiver}; use style::Stylesheet; -use url::Url; +use url::{Url, UrlParser}; macro_rules! handle_element( ($document: expr, @@ -421,8 +420,9 @@ pub fn parse_html(page: &Page, s.as_slice().eq_ignore_ascii_case("stylesheet") }) => { debug!("found CSS stylesheet: {:s}", *href); - match try_parse_url(href.as_slice(), Some(url2.clone())) { - Ok(url) => css_chan2.send(CSSTaskNewFile(UrlProvenance(url, resource_task.clone()))), + match UrlParser::new().base_url(&url2).parse(href.as_slice()) { + Ok(url) => css_chan2.send(CSSTaskNewFile( + UrlProvenance(url, resource_task.clone()))), Err(e) => debug!("Parsing url {:s} failed: {:s}", *href, e) }; } @@ -504,9 +504,10 @@ pub fn parse_html(page: &Page, match script.get_attribute(Null, "src").root() { Some(src) => { debug!("found script: {:s}", src.deref().Value()); - match try_parse_url(src.deref().value().as_slice(), Some(url3.clone())) { - Ok(new_url) => js_chan2.send(JSTaskNewFile(new_url)), - Err(e) => debug!("Parsing url {:s} failed: {:s}", src.deref().Value(), e) + match UrlParser::new().base_url(&url3) + .parse(src.deref().value().as_slice()) { + Ok(new_url) => js_chan2.send(JSTaskNewFile(new_url)), + Err(e) => debug!("Parsing url {:s} failed: {:s}", src.deref().Value(), e) }; } None => { |