aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorDaniel Johnson <danielj41@gmail.com>2017-08-27 21:42:14 -0700
committerDaniel Johnson <danielj41@gmail.com>2017-08-27 21:58:11 -0700
commitff786a050a9b8c8f526130e4bca9b2208f7998c4 (patch)
tree19b06392880085ad2f6bf53bfaa690cb9db56529 /components/script/script_thread.rs
parentaf41769d70e134fa7013127604e8ecbf7ace24a5 (diff)
downloadservo-ff786a050a9b8c8f526130e4bca9b2208f7998c4.tar.gz
servo-ff786a050a9b8c8f526130e4bca9b2208f7998c4.zip
"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.
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index e234805f0b6..dc19687fb06 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -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 => {