mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Remove the url from the InputUrl variant.
This url is the pre-redirect url, which is not particularly meaningful, and it is used only in a panic message.
This commit is contained in:
parent
e76c3386ce
commit
0fc65d4088
2 changed files with 7 additions and 7 deletions
|
@ -33,7 +33,7 @@ use string_cache::QualName;
|
||||||
|
|
||||||
pub enum HTMLInput {
|
pub enum HTMLInput {
|
||||||
InputString(String),
|
InputString(String),
|
||||||
InputUrl(Url, LoadResponse),
|
InputUrl(LoadResponse),
|
||||||
}
|
}
|
||||||
|
|
||||||
trait SinkHelpers {
|
trait SinkHelpers {
|
||||||
|
@ -163,8 +163,8 @@ impl<'a> TreeSink<TrustedNodeAddress> for servohtmlparser::Sink {
|
||||||
|
|
||||||
pub fn parse_html(document: JSRef<Document>,
|
pub fn parse_html(document: JSRef<Document>,
|
||||||
input: HTMLInput,
|
input: HTMLInput,
|
||||||
base_url: Url) {
|
url: Url) {
|
||||||
let parser = ServoHTMLParser::new(Some(base_url.clone()), document).root();
|
let parser = ServoHTMLParser::new(Some(url.clone()), document).root();
|
||||||
let parser: JSRef<ServoHTMLParser> = *parser;
|
let parser: JSRef<ServoHTMLParser> = *parser;
|
||||||
|
|
||||||
task_state::enter(IN_HTML_PARSER);
|
task_state::enter(IN_HTML_PARSER);
|
||||||
|
@ -173,10 +173,10 @@ pub fn parse_html(document: JSRef<Document>,
|
||||||
InputString(s) => {
|
InputString(s) => {
|
||||||
parser.parse_chunk(s);
|
parser.parse_chunk(s);
|
||||||
}
|
}
|
||||||
InputUrl(url, load_response) => {
|
InputUrl(load_response) => {
|
||||||
match load_response.metadata.content_type {
|
match load_response.metadata.content_type {
|
||||||
Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case("image") => {
|
Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case("image") => {
|
||||||
let page = format!("<html><body><img src='{:s}' /></body></html>", base_url.serialize());
|
let page = format!("<html><body><img src='{:s}' /></body></html>", url.serialize());
|
||||||
parser.parse_chunk(page);
|
parser.parse_chunk(page);
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
|
|
|
@ -748,7 +748,7 @@ impl ScriptTask {
|
||||||
// Wait for the LoadResponse so that the parser knows the final URL.
|
// Wait for the LoadResponse so that the parser knows the final URL.
|
||||||
let (input_chan, input_port) = channel();
|
let (input_chan, input_port) = channel();
|
||||||
self.resource_task.send(Load(NetLoadData {
|
self.resource_task.send(Load(NetLoadData {
|
||||||
url: url.clone(),
|
url: url,
|
||||||
method: load_data.method,
|
method: load_data.method,
|
||||||
headers: load_data.headers,
|
headers: load_data.headers,
|
||||||
data: load_data.data,
|
data: load_data.data,
|
||||||
|
@ -773,7 +773,7 @@ impl ScriptTask {
|
||||||
*page.mut_url() = Some((base_url.clone(), true));
|
*page.mut_url() = Some((base_url.clone(), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
(InputUrl(url.clone(), load_response), base_url)
|
(InputUrl(load_response), base_url)
|
||||||
} else {
|
} else {
|
||||||
let evalstr = load_data.url.non_relative_scheme_data().unwrap();
|
let evalstr = load_data.url.non_relative_scheme_data().unwrap();
|
||||||
let jsval = window.evaluate_js_with_result(evalstr);
|
let jsval = window.evaluate_js_with_result(evalstr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue