mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 06:18:38 +09:00
Bug 1311798: Align XMLHttpRequest abort() with the spec
This commit is contained in:
parent
e95eff8e11
commit
5cc122a538
4 changed files with 82 additions and 6 deletions
|
|
@ -1669,7 +1669,9 @@ XMLHttpRequestWorker::MaybeDispatchPrematureAbortEvents(ErrorResult& aRv)
|
|||
|
||||
// Only send readystatechange event when state changed.
|
||||
bool isStateChanged = false;
|
||||
if (mStateData.mReadyState != 4) {
|
||||
if ((mStateData.mReadyState == 1 && mStateData.mFlagSend) ||
|
||||
mStateData.mReadyState == 2 ||
|
||||
mStateData.mReadyState == 3) {
|
||||
isStateChanged = true;
|
||||
mStateData.mReadyState = 4;
|
||||
}
|
||||
|
|
@ -1811,6 +1813,8 @@ XMLHttpRequestWorker::SendInternal(SendRunnable* aRunnable,
|
|||
aRunnable->SetSyncLoopTarget(syncLoopTarget);
|
||||
aRunnable->SetHaveUploadListeners(hasUploadListeners);
|
||||
|
||||
mStateData.mFlagSend = true;
|
||||
|
||||
aRunnable->Dispatch(aRv);
|
||||
if (aRv.Failed()) {
|
||||
// Dispatch() may have spun the event loop and we may have already unrooted.
|
||||
|
|
@ -1837,6 +1841,7 @@ XMLHttpRequestWorker::SendInternal(SendRunnable* aRunnable,
|
|||
if (!autoSyncLoop->Run() && !aRv.Failed()) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
}
|
||||
mStateData.mFlagSend = false;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue