mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Load bare images within an HTML document (#3108)
This commit is contained in:
parent
2ce5b46bba
commit
22ed3d620d
1 changed files with 17 additions and 12 deletions
|
@ -526,9 +526,13 @@ pub fn parse_html(page: &Page,
|
|||
};
|
||||
parser.set_tree_handler(&mut tree_handler);
|
||||
debug!("set tree handler");
|
||||
|
||||
debug!("loaded page");
|
||||
loop {
|
||||
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());
|
||||
parser.parse_chunk(page.into_bytes().as_slice());
|
||||
},
|
||||
_ => loop {
|
||||
match load_response.progress_port.recv() {
|
||||
Payload(data) => {
|
||||
debug!("received data");
|
||||
|
@ -542,6 +546,7 @@ pub fn parse_html(page: &Page,
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debug!("finished parsing");
|
||||
css_chan.send(CSSTaskExit);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue