Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XHR - Trigger readystatechange when transitioning from HEADERS_RECEIVED to DONE #3917

Merged
merged 2 commits into from Nov 7, 2014
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

XHR - Trigger readystatechange when transitioning from HEADERS_RECEIV…

…ED to DONE

Fixes #3877
  • Loading branch information
mukilan committed Nov 6, 2014
commit dc02352564618f2af412a6721d2de7906703bfc5
@@ -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);
@@ -1,6 +1,5 @@
[anonymous-mode-unsupported.htm]
type: testharness
expected: TIMEOUT
[XMLHttpRequest: anonymous mode unsupported]
expected: TIMEOUT
expected: FAIL

This file was deleted.

@@ -1,3 +1,8 @@
[response-json.htm]
type: testharness
expected: TIMEOUT
[JSON object roundtrip]
expected: FAIL

[JSON roundtrip with Japanese text]
expected: FAIL

@@ -1,9 +1,8 @@
[send-entity-body-get-head-async.htm]
type: testharness
expected: TIMEOUT
[XMLHttpRequest: send() - non-empty data argument and GET/HEAD - async, no upload events should fire (GET)]
expected: NOTRUN
expected: FAIL

[XMLHttpRequest: send() - non-empty data argument and GET/HEAD - async, no upload events should fire (HEAD)]
expected: NOTRUN
expected: FAIL

This file was deleted.

This file was deleted.

@@ -1,3 +1,8 @@
[status-async.htm]
type: testharness
expected: TIMEOUT
[XMLHttpRequest: status/statusText - various responses 7 (GET 402)]
expected: FAIL

[XMLHttpRequest: status/statusText - various responses 9 (CHICKEN 402)]
expected: FAIL

This file was deleted.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.