зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset d5c26d99978e (bug 1642193) for wpt failures on event-timeout-order.any.worker.html . CLOSED TREE
This commit is contained in:
Родитель
86aa1a058e
Коммит
fe40425f38
|
@ -120,8 +120,6 @@ class Proxy final : public nsIDOMEventListener {
|
|||
bool mLastUploadLengthComputable;
|
||||
bool mSeenLoadStart;
|
||||
bool mSeenUploadLoadStart;
|
||||
bool mDispatchPrematureAbortEvent;
|
||||
bool mDispatchPrematureAbortEventToUpload;
|
||||
|
||||
// Only touched on the main thread.
|
||||
bool mUploadEventListenersAttached;
|
||||
|
@ -153,8 +151,6 @@ class Proxy final : public nsIDOMEventListener {
|
|||
mLastUploadLengthComputable(false),
|
||||
mSeenLoadStart(false),
|
||||
mSeenUploadLoadStart(false),
|
||||
mDispatchPrematureAbortEvent(false),
|
||||
mDispatchPrematureAbortEventToUpload(false),
|
||||
mUploadEventListenersAttached(false),
|
||||
mMainThreadSeenLoadStart(false),
|
||||
mInOpen(false) {}
|
||||
|
@ -266,13 +262,13 @@ enum {
|
|||
STRING_loadstart,
|
||||
STRING_progress,
|
||||
STRING_timeout,
|
||||
STRING_loadend,
|
||||
STRING_readystatechange,
|
||||
STRING_loadend,
|
||||
|
||||
STRING_COUNT,
|
||||
|
||||
STRING_LAST_XHR = STRING_readystatechange,
|
||||
STRING_LAST_EVENTTARGET = STRING_loadend
|
||||
STRING_LAST_XHR = STRING_loadend,
|
||||
STRING_LAST_EVENTTARGET = STRING_timeout
|
||||
};
|
||||
|
||||
static_assert(STRING_LAST_XHR >= STRING_LAST_EVENTTARGET, "Bad string setup!");
|
||||
|
@ -286,10 +282,10 @@ const char* const sEventStrings[] = {
|
|||
"loadstart",
|
||||
"progress",
|
||||
"timeout",
|
||||
"loadend",
|
||||
|
||||
// XMLHttpRequest event types, supported only by XHR.
|
||||
"readystatechange",
|
||||
"loadend",
|
||||
};
|
||||
|
||||
static_assert(MOZ_ARRAY_LENGTH(sEventStrings) == STRING_COUNT,
|
||||
|
@ -1074,20 +1070,16 @@ bool EventRunnable::WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) {
|
|||
} else if (mType.EqualsASCII(sEventStrings[STRING_loadend])) {
|
||||
if (mUploadEvent) {
|
||||
mProxy->mSeenUploadLoadStart = false;
|
||||
if (mProxy->mDispatchPrematureAbortEventToUpload) {
|
||||
// We've already dispatched premature abort events.
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
mProxy->mSeenLoadStart = false;
|
||||
if (mProxy->mDispatchPrematureAbortEvent) {
|
||||
if (!mProxy->mSeenLoadStart) {
|
||||
// We've already dispatched premature abort events.
|
||||
return true;
|
||||
}
|
||||
mProxy->mSeenLoadStart = false;
|
||||
}
|
||||
} else if (mType.EqualsASCII(sEventStrings[STRING_abort])) {
|
||||
if ((mUploadEvent && mProxy->mDispatchPrematureAbortEventToUpload) ||
|
||||
(!mUploadEvent && mProxy->mDispatchPrematureAbortEvent)) {
|
||||
if ((mUploadEvent && !mProxy->mSeenUploadLoadStart) ||
|
||||
(!mUploadEvent && !mProxy->mSeenLoadStart)) {
|
||||
// We've already dispatched premature abort events.
|
||||
return true;
|
||||
}
|
||||
|
@ -1506,7 +1498,6 @@ void XMLHttpRequestWorker::MaybeDispatchPrematureAbortEvents(ErrorResult& aRv) {
|
|||
}
|
||||
|
||||
mProxy->mSeenUploadLoadStart = false;
|
||||
mProxy->mDispatchPrematureAbortEventToUpload = true;
|
||||
}
|
||||
|
||||
if (mProxy->mSeenLoadStart) {
|
||||
|
@ -1535,7 +1526,6 @@ void XMLHttpRequestWorker::MaybeDispatchPrematureAbortEvents(ErrorResult& aRv) {
|
|||
}
|
||||
|
||||
mProxy->mSeenLoadStart = false;
|
||||
mProxy->mDispatchPrematureAbortEvent = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1653,8 +1643,6 @@ void XMLHttpRequestWorker::SendInternal(const BodyExtractorBase* aBody,
|
|||
}
|
||||
|
||||
mProxy->mOuterChannelId++;
|
||||
mProxy->mDispatchPrematureAbortEvent = false;
|
||||
mProxy->mDispatchPrematureAbortEventToUpload = false;
|
||||
|
||||
sendRunnable->SetSyncLoopTarget(syncLoopTarget);
|
||||
sendRunnable->SetHaveUploadListeners(hasUploadListeners);
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
[abort-upload-event-abort.any.worker.html]
|
||||
expected: TIMEOUT
|
||||
[XMLHttpRequest: The abort() method: Fire a progress event named abort on the XMLHttpRequestUpload object]
|
||||
expected: TIMEOUT
|
||||
|
||||
|
||||
[abort-upload-event-abort.any.html]
|
|
@ -0,0 +1,7 @@
|
|||
[abort-upload-event-loadend.any.html]
|
||||
|
||||
[abort-upload-event-loadend.any.worker.html]
|
||||
expected: TIMEOUT
|
||||
[XMLHttpRequest: The abort() method: Fire a progress event named loadend on the XMLHttpRequestUpload object]
|
||||
expected: TIMEOUT
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
[event-timeout-order.any.html]
|
||||
|
||||
[event-timeout-order.any.worker.html]
|
||||
[XMLHttpRequest: event - timeout (order of events)]
|
||||
expected: FAIL
|
||||
|
Загрузка…
Ссылка в новой задаче