Skip to content

Commit

Permalink
servo: Merge #13485 - Make readystatechange fire more often (fixes #1…
Browse files Browse the repository at this point in the history
…3481) (from mathieuh:xhr-event); r=jdm

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #13481 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: d42235ee905acf6bea7f5983c77124b8be9656fc
  • Loading branch information
Mathieu Hordesseaux committed Oct 4, 2016
1 parent fc6b0f7 commit 17f56ef
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions servo/components/script/dom/xmlhttprequest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,9 +973,16 @@ impl XMLHttpRequest {
*self.response.borrow_mut() = partial_response;
if !self.sync.get() {
if self.ready_state.get() == XMLHttpRequestState::HeadersReceived {
self.change_ready_state(XMLHttpRequestState::Loading);
return_if_fetch_was_terminated!();
self.ready_state.set(XMLHttpRequestState::Loading);
}
let global = self.global();
let event = Event::new(
global.r(),
atom!("readystatechange"),
EventBubbles::DoesNotBubble,
EventCancelable::Cancelable);
event.fire(self.upcast());
return_if_fetch_was_terminated!();
self.dispatch_response_progress_event(atom!("progress"));
}
},
Expand Down

0 comments on commit 17f56ef

Please sign in to comment.