mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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 {
|
||||
InputString(String),
|
||||
InputUrl(Url, LoadResponse),
|
||||
InputUrl(LoadResponse),
|
||||
}
|
||||
|
||||
trait SinkHelpers {
|
||||
|
@ -163,8 +163,8 @@ impl<'a> TreeSink<TrustedNodeAddress> for servohtmlparser::Sink {
|
|||
|
||||
pub fn parse_html(document: JSRef<Document>,
|
||||
input: HTMLInput,
|
||||
base_url: Url) {
|
||||
let parser = ServoHTMLParser::new(Some(base_url.clone()), document).root();
|
||||
url: Url) {
|
||||
let parser = ServoHTMLParser::new(Some(url.clone()), document).root();
|
||||
let parser: JSRef<ServoHTMLParser> = *parser;
|
||||
|
||||
task_state::enter(IN_HTML_PARSER);
|
||||
|
@ -173,10 +173,10 @@ pub fn parse_html(document: JSRef<Document>,
|
|||
InputString(s) => {
|
||||
parser.parse_chunk(s);
|
||||
}
|
||||
InputUrl(url, load_response) => {
|
||||
InputUrl(load_response) => {
|
||||
match load_response.metadata.content_type {
|
||||
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);
|
||||
},
|
||||
_ => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue