mirror of
https://github.com/servo/servo.git
synced 2025-06-19 14:48:59 +01:00
Auto merge of #25610 - pshaughn:abortfix, r=Manishearth
do less on abort if not done Abort() was resetting state when it didn't need to, and possibly also not resetting as much of it as it needed to. I'm not sure if this is a completely correct fix but it passes some WPT tests. --- <!-- 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 #24931 <!-- Either: --> - [X] There are tests for these change <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
d0f64d9d56
4 changed files with 15 additions and 29 deletions
|
@ -758,7 +758,12 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
|
|||
}
|
||||
}
|
||||
// Step 3
|
||||
self.ready_state.set(XMLHttpRequestState::Unsent);
|
||||
if self.ready_state.get() == XMLHttpRequestState::Done {
|
||||
self.change_ready_state(XMLHttpRequestState::Unsent);
|
||||
self.response_status.set(Err(()));
|
||||
self.response.borrow_mut().clear();
|
||||
self.response_headers.borrow_mut().clear();
|
||||
}
|
||||
}
|
||||
|
||||
// https://xhr.spec.whatwg.org/#the-responseurl-attribute
|
||||
|
@ -961,6 +966,7 @@ impl XMLHttpRequest {
|
|||
fn change_ready_state(&self, rs: XMLHttpRequestState) {
|
||||
assert_ne!(self.ready_state.get(), rs);
|
||||
self.ready_state.set(rs);
|
||||
if rs != XMLHttpRequestState::Unsent {
|
||||
let event = Event::new(
|
||||
&self.global(),
|
||||
atom!("readystatechange"),
|
||||
|
@ -969,6 +975,7 @@ impl XMLHttpRequest {
|
|||
);
|
||||
event.fire(self.upcast());
|
||||
}
|
||||
}
|
||||
|
||||
fn process_headers_available(
|
||||
&self,
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
[abort-during-open.any.worker.html]
|
||||
[XMLHttpRequest: abort() during OPEN]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[abort-during-open.any.html]
|
||||
[XMLHttpRequest: abort() during OPEN]
|
||||
expected: FAIL
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
[abort-event-abort.any.html]
|
||||
[XMLHttpRequest: The abort() method: do not fire abort event in OPENED state when send() flag is unset.]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[abort-event-abort.any.worker.html]
|
||||
[XMLHttpRequest: The abort() method: do not fire abort event in OPENED state when send() flag is unset.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
[send-data-unexpected-tostring.htm]
|
||||
type: testharness
|
||||
[abort() called from data stringification]
|
||||
expected: FAIL
|
||||
|
||||
[open() called from data stringification]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue