mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
"javascript:" urls: clean up after aborting a page load
Problem: After aborting on a 204 or 205 status code, you could no longer follow links on the page. Cause: `constellation.rs` ignores new LoadUrl requests since the aborted one is in its `pending_changes` list. Solution: Send a message to constellation that lets it clean up its `pending_changes` list.
This commit is contained in:
parent
af41769d70
commit
ff786a050a
3 changed files with 22 additions and 4 deletions
|
@ -1676,19 +1676,19 @@ impl ScriptThread {
|
|||
// the pipeline exited before the page load completed.
|
||||
match idx {
|
||||
Some(idx) => {
|
||||
let load = self.incomplete_loads.borrow_mut().remove(idx);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#process-a-navigate-response
|
||||
// 2. If response's status is 204 or 205, then abort these steps.
|
||||
match metadata {
|
||||
Some(Metadata { status: Some((204 ... 205, _)), .. }) => {
|
||||
// TODO: This leaves the page in a broken state where you can't follow
|
||||
// other links. Fix this.
|
||||
self.script_sender
|
||||
.send((id.clone(), ScriptMsg::AbortLoadUrl))
|
||||
.unwrap();
|
||||
return None;
|
||||
},
|
||||
_ => ()
|
||||
};
|
||||
|
||||
let load = self.incomplete_loads.borrow_mut().remove(idx);
|
||||
metadata.map(|meta| self.load(meta, load))
|
||||
}
|
||||
None => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue