mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
auto merge of #3917 : mukilan/servo/xhr-status-async, r=jdm
Fixes #3877
This commit is contained in:
commit
338a9c3f05
9 changed files with 30 additions and 99 deletions
|
@ -890,8 +890,8 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> {
|
|||
},
|
||||
LoadingMsg(_, partial_response) => {
|
||||
// For synchronous requests, this should not fire any events, and just store data
|
||||
// Part of step 13, send() (processing response body)
|
||||
// XXXManishearth handle errors, if any (substep 1)
|
||||
// Part of step 11, send() (processing response body)
|
||||
// XXXManishearth handle errors, if any (substep 2)
|
||||
|
||||
*self.response.borrow_mut() = partial_response;
|
||||
if !self.sync.get() {
|
||||
|
@ -903,22 +903,23 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> {
|
|||
}
|
||||
},
|
||||
DoneMsg(_) => {
|
||||
// Part of step 13, send() (processing response end of file)
|
||||
// XXXManishearth handle errors, if any (substep 1)
|
||||
assert!(self.ready_state.get() == HeadersReceived ||
|
||||
self.ready_state.get() == Loading ||
|
||||
self.sync.get());
|
||||
|
||||
// Substep 3
|
||||
if self.ready_state.get() == Loading || self.sync.get() {
|
||||
// Subsubsteps 2-4
|
||||
self.send_flag.set(false);
|
||||
self.change_ready_state(XHRDone);
|
||||
return_if_fetch_was_terminated!();
|
||||
// Subsubsteps 5-7
|
||||
self.dispatch_response_progress_event("progress".to_string());
|
||||
return_if_fetch_was_terminated!();
|
||||
self.dispatch_response_progress_event("load".to_string());
|
||||
return_if_fetch_was_terminated!();
|
||||
self.dispatch_response_progress_event("loadend".to_string());
|
||||
}
|
||||
// Part of step 11, send() (processing response end of file)
|
||||
// XXXManishearth handle errors, if any (substep 2)
|
||||
|
||||
// Subsubsteps 5-7
|
||||
self.send_flag.set(false);
|
||||
self.change_ready_state(XHRDone);
|
||||
return_if_fetch_was_terminated!();
|
||||
// Subsubsteps 10-12
|
||||
self.dispatch_response_progress_event("progress".to_string());
|
||||
return_if_fetch_was_terminated!();
|
||||
self.dispatch_response_progress_event("load".to_string());
|
||||
return_if_fetch_was_terminated!();
|
||||
self.dispatch_response_progress_event("loadend".to_string());
|
||||
},
|
||||
ErroredMsg(_, e) => {
|
||||
self.send_flag.set(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue