зеркало из 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 mLastUploadLengthComputable;
|
||||||
bool mSeenLoadStart;
|
bool mSeenLoadStart;
|
||||||
bool mSeenUploadLoadStart;
|
bool mSeenUploadLoadStart;
|
||||||
bool mDispatchPrematureAbortEvent;
|
|
||||||
bool mDispatchPrematureAbortEventToUpload;
|
|
||||||
|
|
||||||
// Only touched on the main thread.
|
// Only touched on the main thread.
|
||||||
bool mUploadEventListenersAttached;
|
bool mUploadEventListenersAttached;
|
||||||
|
@ -153,8 +151,6 @@ class Proxy final : public nsIDOMEventListener {
|
||||||
mLastUploadLengthComputable(false),
|
mLastUploadLengthComputable(false),
|
||||||
mSeenLoadStart(false),
|
mSeenLoadStart(false),
|
||||||
mSeenUploadLoadStart(false),
|
mSeenUploadLoadStart(false),
|
||||||
mDispatchPrematureAbortEvent(false),
|
|
||||||
mDispatchPrematureAbortEventToUpload(false),
|
|
||||||
mUploadEventListenersAttached(false),
|
mUploadEventListenersAttached(false),
|
||||||
mMainThreadSeenLoadStart(false),
|
mMainThreadSeenLoadStart(false),
|
||||||
mInOpen(false) {}
|
mInOpen(false) {}
|
||||||
|
@ -266,13 +262,13 @@ enum {
|
||||||
STRING_loadstart,
|
STRING_loadstart,
|
||||||
STRING_progress,
|
STRING_progress,
|
||||||
STRING_timeout,
|
STRING_timeout,
|
||||||
STRING_loadend,
|
|
||||||
STRING_readystatechange,
|
STRING_readystatechange,
|
||||||
|
STRING_loadend,
|
||||||
|
|
||||||
STRING_COUNT,
|
STRING_COUNT,
|
||||||
|
|
||||||
STRING_LAST_XHR = STRING_readystatechange,
|
STRING_LAST_XHR = STRING_loadend,
|
||||||
STRING_LAST_EVENTTARGET = STRING_loadend
|
STRING_LAST_EVENTTARGET = STRING_timeout
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert(STRING_LAST_XHR >= STRING_LAST_EVENTTARGET, "Bad string setup!");
|
static_assert(STRING_LAST_XHR >= STRING_LAST_EVENTTARGET, "Bad string setup!");
|
||||||
|
@ -286,10 +282,10 @@ const char* const sEventStrings[] = {
|
||||||
"loadstart",
|
"loadstart",
|
||||||
"progress",
|
"progress",
|
||||||
"timeout",
|
"timeout",
|
||||||
"loadend",
|
|
||||||
|
|
||||||
// XMLHttpRequest event types, supported only by XHR.
|
// XMLHttpRequest event types, supported only by XHR.
|
||||||
"readystatechange",
|
"readystatechange",
|
||||||
|
"loadend",
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert(MOZ_ARRAY_LENGTH(sEventStrings) == STRING_COUNT,
|
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])) {
|
} else if (mType.EqualsASCII(sEventStrings[STRING_loadend])) {
|
||||||
if (mUploadEvent) {
|
if (mUploadEvent) {
|
||||||
mProxy->mSeenUploadLoadStart = false;
|
mProxy->mSeenUploadLoadStart = false;
|
||||||
if (mProxy->mDispatchPrematureAbortEventToUpload) {
|
|
||||||
// We've already dispatched premature abort events.
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
mProxy->mSeenLoadStart = false;
|
if (!mProxy->mSeenLoadStart) {
|
||||||
if (mProxy->mDispatchPrematureAbortEvent) {
|
|
||||||
// We've already dispatched premature abort events.
|
// We've already dispatched premature abort events.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
mProxy->mSeenLoadStart = false;
|
||||||
}
|
}
|
||||||
} else if (mType.EqualsASCII(sEventStrings[STRING_abort])) {
|
} else if (mType.EqualsASCII(sEventStrings[STRING_abort])) {
|
||||||
if ((mUploadEvent && mProxy->mDispatchPrematureAbortEventToUpload) ||
|
if ((mUploadEvent && !mProxy->mSeenUploadLoadStart) ||
|
||||||
(!mUploadEvent && mProxy->mDispatchPrematureAbortEvent)) {
|
(!mUploadEvent && !mProxy->mSeenLoadStart)) {
|
||||||
// We've already dispatched premature abort events.
|
// We've already dispatched premature abort events.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1506,7 +1498,6 @@ void XMLHttpRequestWorker::MaybeDispatchPrematureAbortEvents(ErrorResult& aRv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
mProxy->mSeenUploadLoadStart = false;
|
mProxy->mSeenUploadLoadStart = false;
|
||||||
mProxy->mDispatchPrematureAbortEventToUpload = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mProxy->mSeenLoadStart) {
|
if (mProxy->mSeenLoadStart) {
|
||||||
|
@ -1535,7 +1526,6 @@ void XMLHttpRequestWorker::MaybeDispatchPrematureAbortEvents(ErrorResult& aRv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
mProxy->mSeenLoadStart = false;
|
mProxy->mSeenLoadStart = false;
|
||||||
mProxy->mDispatchPrematureAbortEvent = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1653,8 +1643,6 @@ void XMLHttpRequestWorker::SendInternal(const BodyExtractorBase* aBody,
|
||||||
}
|
}
|
||||||
|
|
||||||
mProxy->mOuterChannelId++;
|
mProxy->mOuterChannelId++;
|
||||||
mProxy->mDispatchPrematureAbortEvent = false;
|
|
||||||
mProxy->mDispatchPrematureAbortEventToUpload = false;
|
|
||||||
|
|
||||||
sendRunnable->SetSyncLoopTarget(syncLoopTarget);
|
sendRunnable->SetSyncLoopTarget(syncLoopTarget);
|
||||||
sendRunnable->SetHaveUploadListeners(hasUploadListeners);
|
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
|
||||||
|
|
Загрузка…
Ссылка в новой задаче