diff --git a/src/components/script/html/cssparse.rs b/src/components/script/html/cssparse.rs index 9ee789d6e3e..7d1e4214462 100644 --- a/src/components/script/html/cssparse.rs +++ b/src/components/script/html/cssparse.rs @@ -43,6 +43,7 @@ pub fn spawn_css_parser(provenance: StylesheetProvenance, fn data_stream(provenance: StylesheetProvenance, resource_task: ResourceTask) -> DataStream { match provenance { UrlProvenance(url) => { + debug!("cssparse: loading style sheet at %s", url.to_str()); let (input_port, input_chan) = comm::stream(); resource_task.send(Load(url, input_chan)); resource_port_to_data_stream(input_port) diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index db67b48f035..f604038c58b 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -129,11 +129,13 @@ fn js_script_listener(to_parent: Chan<~[~[u8]]>, buf += data; } Done(Ok(*)) => { - result_chan.send(buf); + result_chan.send(Some(buf)); break; } Done(Err(*)) => { error!("error loading script %s", url.to_str()); + result_chan.send(None); + break; } } } @@ -146,7 +148,7 @@ fn js_script_listener(to_parent: Chan<~[~[u8]]>, } } - let js_scripts = vec::map(result_vec, |result_port| result_port.recv()); + let js_scripts = vec::filter_map(result_vec, |result_port| result_port.recv()); to_parent.send(js_scripts); } diff --git a/src/components/util/url.rs b/src/components/util/url.rs index fea0df23b73..bc7db8f5f32 100644 --- a/src/components/util/url.rs +++ b/src/components/util/url.rs @@ -32,6 +32,8 @@ pub fn make_url(str_url: ~str, current_url: Option) -> Url { debug!("make_url: current_url: %?", current_url); if current_url.path.is_empty() || current_url.path.ends_with("/") { current_url.scheme + "://" + current_url.host + "/" + str_url + } else if str_url.starts_with("//") { + current_url.scheme + ":" + str_url } else { let mut path = ~[]; for str::each_split_char(current_url.path, '/') |p| {